]> git.nega.tv - josh/narcissus/commitdiff
narcissus-font: Remove unnecessary cast
authorJosh Simmons <josh@nega.tv>
Sun, 17 Nov 2024 19:41:31 +0000 (20:41 +0100)
committerJosh Simmons <josh@nega.tv>
Sun, 17 Nov 2024 19:41:31 +0000 (20:41 +0100)
engine/narcissus-font/src/font.rs

index 4e87090d68ba42e4dac00bbd8c90e14e4a034d17..d13967f25bf01082bce0bf665ab7904fc9b7d6fa 100644 (file)
@@ -136,8 +136,7 @@ impl<'a> Font<'a> {
         let mut glyph_index_cache = [None; ASCII_PRINTABLE_COUNT];
         for (i, printable) in (ASCII_PRINTABLE_FIRST..=ASCII_PRINTABLE_LAST).enumerate() {
             glyph_index_cache[i] =
-                NonZeroI32::new(unsafe { stbtt_FindGlyphIndex(&info, printable as i32) })
-                    .map(GlyphIndex);
+                NonZeroI32::new(unsafe { stbtt_FindGlyphIndex(&info, printable) }).map(GlyphIndex);
         }
 
         // SAFETY: Safe to zero as all zero bytes f32 is 0.0