Skip to content

Commit 7cf3952

Browse files
Merge #422
422: Simplify the output code a bit more for another slight speedup r=burrbull a=therealprof Signed-off-by: Daniel Egger <[email protected]> Co-authored-by: Daniel Egger <[email protected]>
2 parents 3033233 + ac0183c commit 7cf3952

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ mod errors;
1212
mod generate;
1313
mod util;
1414

15-
use std::fmt::Write as _;
1615
use std::fs::File;
1716
use std::io::Write;
1817
use std::process;
@@ -103,9 +102,7 @@ fn run() -> Result<()> {
103102
let items = generate::device::render(&device, target, nightly, generic_mod, &mut device_x)?;
104103
let mut file = File::create("lib.rs").expect("Couldn't create lib.rs file");
105104

106-
let mut data = String::new();
107-
write!(data, "{}", items).expect("Could not output code");
108-
let data = data.replace("] ", "]\n");
105+
let data = items.to_string().replace("] ", "]\n");
109106
file.write_all(data.as_ref())
110107
.expect("Could not write code to lib.rs");
111108

0 commit comments

Comments
 (0)