Skip to content

Commit c1408f1

Browse files
[autofix.ci] apply automated fixes
1 parent ad2a17b commit c1408f1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

crates/oxc_formatter/build.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,7 @@ fn sanitize_module_name(name: &str) -> String {
176176
fn 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 {
195191
fn is_reserved_keyword(s: &str) -> bool {
196192
matches!(
197193
s,
198-
"mod" | "fn"
194+
"mod"
195+
| "fn"
199196
| "let"
200197
| "mut"
201198
| "const"

0 commit comments

Comments
 (0)