diff --git a/src/block.rs b/src/block.rs index fb23de3..583ef06 100644 --- a/src/block.rs +++ b/src/block.rs @@ -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()) }