Skip to content

Commit aa97695

Browse files
committed
prepend x also if field name starts anything that is not ascii_alphapetic
1 parent 2d8510a commit aa97695

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ fn type_name(x: &str) -> String {
523523
}
524524

525525
fn field_name(x: &str) -> String {
526-
if keywords::is_keyword(x) {
526+
if keywords::is_keyword(x) || !x.starts_with(|c: char| c.is_ascii_alphabetic()) {
527527
format!("x{}", x.to_snake_case())
528528
} else {
529529
x.to_snake_case()

0 commit comments

Comments
 (0)