Skip to content

Commit

Permalink
Merge pull request #1221 from dtolnay/litparse
Browse files Browse the repository at this point in the history
Bypass a round trip through TokenBuffer in LitStr::parse
  • Loading branch information
dtolnay committed Sep 24, 2022
2 parents 638e967 + ea637b2 commit 8f0368e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lit.rs
Expand Up @@ -224,7 +224,7 @@ impl LitStr {

// Parse string literal into a token stream with every span equal to the
// original literal's span.
let mut tokens = crate::parse_str(&self.value())?;
let mut tokens = TokenStream::from_str(&self.value())?;
tokens = respan_token_stream(tokens, self.span());

parser.parse2(tokens)
Expand Down

0 comments on commit 8f0368e

Please sign in to comment.