Skip to content

Commit 27351ab

Browse files
[fearless_simd_gen]: Fix rustfmt style_edition defaulting to 2015 (#13)
Generated code is formatted with rustfmt. However, by default rustfmt uses the 2015 edition. This PR adds rustfmt.toml such that generating the code and cargo fmt match.
1 parent 9827431 commit 27351ab

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

fearless_simd_gen/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ impl Module {
5656
}
5757
}
5858

59-
fn generate_string(self) -> String {
59+
fn generate_string(self, name: &str) -> String {
6060
let code = self.generate_code();
61-
let parsed = syn::parse_file(&code.to_string()).expect("error parsing {name}");
61+
let parsed = syn::parse_file(&code.to_string()).expect(&format!("error parsing {name}"));
6262
let code_str = prettyplease::unparse(&parsed);
6363
format!("// This file is autogenerated by fearless_simd_gen\n\n{code_str}")
6464
}
@@ -101,7 +101,7 @@ fn main() {
101101
let name = module.file_base();
102102
let path = base_dir.join(format!("{name}.rs"));
103103
let file = File::create(&path).expect("error creating {path:?}");
104-
let code_str = module.generate_string();
104+
let code_str = module.generate_string(name);
105105
write_formatted(code_str.as_bytes(), file);
106106
}
107107
}

rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
edition = "2024"

0 commit comments

Comments
 (0)