Skip to content

Commit

Permalink
Merge pull request #1087 from dtolnay/literalparse
Browse files Browse the repository at this point in the history
Use 'FromStr for Literal' instead of TokenStream workaround
  • Loading branch information
dtolnay committed Oct 26, 2021
2 parents 68e7ab8 + 0fda5ad commit 30984ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -36,7 +36,7 @@ proc-macro = ["proc-macro2/proc-macro", "quote/proc-macro"]
test = ["syn-test-suite/all-features"]

[dependencies]
proc-macro2 = { version = "1.0.26", default-features = false }
proc-macro2 = { version = "1.0.27", default-features = false }
quote = { version = "1.0", optional = true, default-features = false }
unicode-xid = "0.2"

Expand Down
7 changes: 1 addition & 6 deletions src/lit.rs
Expand Up @@ -925,7 +925,6 @@ mod printing {
mod value {
use super::*;
use crate::bigint::BigInt;
use proc_macro2::TokenStream;
use std::char;
use std::ops::{Index, RangeFrom};

Expand Down Expand Up @@ -1564,11 +1563,7 @@ mod value {
digits.parse().ok().map(Literal::i64_unsuffixed)
}
} else {
let stream = repr.parse::<TokenStream>().unwrap();
match stream.into_iter().next().unwrap() {
TokenTree::Literal(l) => Some(l),
_ => unreachable!(),
}
Some(repr.parse::<Literal>().unwrap())
}
}
}

0 comments on commit 30984ec

Please sign in to comment.