Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-graves committed May 10, 2023
1 parent 0323780 commit 7c895f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ fn litstr_to_ident(l: &LitStr) -> syn::Ident {
})
.collect();

id = id.replace("__", "_").trim_end_matches('_').to_string();
while id.contains("__") {
id = id.replace("__", "_");
}

id = id.trim_end_matches('_').to_string();

syn::Ident::new(&id, l.span())
}

0 comments on commit 7c895f9

Please # to comment.