diff options
Diffstat (limited to 'build.rs')
-rw-r--r-- | build.rs | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -51,7 +51,7 @@ impl FontMetadata { ); image[0] = (width & 0b0000_0000_1111_1111) as u8; - image[1] = (width & 0b1111_1111_0000_0000 << 8) as u8; + image[1] = (width & (0b1111_1111_0000_0000 << 8)) as u8; if (image[0] as u16) | (image[1] as u16 >> 8) != width as u16 { panic!("Width missmatch!"); } @@ -78,7 +78,7 @@ impl FontMetadata { if i >= 0 { if i as u16 == width { i = 0; - image2.push('\n' as u8); + image2.push(b'\n'); } let v = format!("{:x?}", bit); let v = if v.len() == 1 { format!("0{}", v) } else { v }; @@ -178,11 +178,9 @@ pub const FONT{}: {name}Struct = {name}Struct{{ fn main() -> Result<(), Box<dyn std::error::Error>> { fs::create_dir_all("src/generated")?; - let mut modrs = format!( - "// Copyright is a sham this is a @generated file. + let mut modrs = "// Copyright is a sham this is a @generated file. use crate::font::BakedFont; -" - ); +".to_string(); let fonts = [ FontMetadata { name: "Galmuri", @@ -205,6 +203,6 @@ use crate::font::BakedFont; ); exec(font)?; } - File::create(&"src/generated/fonts.rs")?.write_all(modrs.as_bytes())?; + File::create("src/generated/fonts.rs")?.write_all(modrs.as_bytes())?; Ok(()) } |