Skip to content

Commit

Permalink
Trim spaces at the end of format capture identifiers
Browse files Browse the repository at this point in the history
format! allows trailing spaces.
  • Loading branch information
gin-ahirsch committed Mar 11, 2024
1 parent 8b781ba commit 89da3cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion strum_macros/src/macros/strings/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn capture_format_string_idents(string_literal: &LitStr) -> syn::Result<Vec<Iden
))?;

let inside_brackets = &format_str[start_index + 1..i];
let ident_str = inside_brackets.split(":").next().unwrap();
let ident_str = inside_brackets.split(":").next().unwrap().trim_end();
let ident = syn::parse_str::<Ident>(ident_str).map_err(|_| {
syn::Error::new_spanned(
string_literal,
Expand Down

0 comments on commit 89da3cc

Please sign in to comment.