Skip to content

Commit

Permalink
js: Remove unnecessary .clone() when parsing expression
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwuelker committed Jul 7, 2024
1 parent d969131 commit a48d5ae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crates/js/src/parser/expressions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ fn parse_primary_expression<const YIELD: bool, const AWAIT: bool>(
Literal::NumericLiteral(n).into()
},
Token::StringLiteral(s) => {
// FIXME: avoiding a clone here would be nice
let s = s.clone();
tokenizer.advance(1);
Literal::StringLiteral(s.clone()).into()
Literal::StringLiteral(s).into()
},
Token::Identifier(_) => {
let identifier_reference = parse_identifier_reference::<YIELD, AWAIT>(tokenizer)?;
Expand Down

0 comments on commit a48d5ae

Please sign in to comment.