File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -176,11 +176,7 @@ fn sanitize_module_name(name: &str) -> String {
176176fn sanitize_identifier ( mut name : String , prefix : & str ) -> String {
177177 // Ensure it starts with a letter or underscore
178178 if name. is_empty ( ) || name. chars ( ) . next ( ) . unwrap ( ) . is_numeric ( ) {
179- name = if prefix. is_empty ( ) {
180- format ! ( "_{name}" )
181- } else {
182- format ! ( "{prefix}_{name}" )
183- } ;
179+ name = if prefix. is_empty ( ) { format ! ( "_{name}" ) } else { format ! ( "{prefix}_{name}" ) } ;
184180 }
185181
186182 // Handle reserved keywords
@@ -195,7 +191,8 @@ fn sanitize_identifier(mut name: String, prefix: &str) -> String {
195191fn is_reserved_keyword ( s : & str ) -> bool {
196192 matches ! (
197193 s,
198- "mod" | "fn"
194+ "mod"
195+ | "fn"
199196 | "let"
200197 | "mut"
201198 | "const"
You can’t perform that action at this time.
0 commit comments