Skip to content

Commit

Permalink
Bypass a round trip through ParseBuffer in LitStr::parse
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 24, 2022
1 parent 638e967 commit ea637b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lit.rs
Original file line number Diff line number Diff line change
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 ea637b2

Please sign in to comment.