Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Into<String> instead of ToString
Browse files Browse the repository at this point in the history
  • Loading branch information
hdamron17 authored and Joshua Nelson committed Aug 16, 2020
1 parent 7393852 commit e5ef1f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lex/cpp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,8 @@ impl<'a> PreProcessor<'a> {
fn int_def(i: i32) -> Definition {
Definition::Object(vec![LiteralToken::Int(RcStr::from(i.to_string())).into()])
}
fn str_def<S: ToString>(s: S) -> Definition {
let rcstr = RcStr::from(format!("\"{}\"", s.to_string().replace(r#"""#, r#"\""#)));
fn str_def<S: Into<String>>(s: S) -> Definition {
let rcstr = RcStr::from(format!("\"{}\"", s.into().replace(r#"""#, r#"\""#)));
Definition::Object(vec![LiteralToken::Str(vec![rcstr]).into()])
}

Expand Down

0 comments on commit e5ef1f6

Please sign in to comment.