File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ pub struct Glyph {
6868}
6969
7070fn parse_bitmap_row ( line : & Line < ' _ > , bitmap : & mut Vec < u8 > ) -> Result < ( ) , ( ) > {
71- if !line. parameters . is_empty ( ) || line. keyword . len ( ) % 2 != 0 {
71+ if !line. parameters . is_empty ( ) || ! line. keyword . len ( ) . is_multiple_of ( 2 ) {
7272 return Err ( ( ) ) ;
7373 }
7474
Original file line number Diff line number Diff line change @@ -278,12 +278,15 @@ impl<'a> FontConverter<'a> {
278278 . iter ( )
279279 . copied ( )
280280 . map ( |c| {
281- let glyph_c =
282- if bdf. glyphs . get ( c) . is_none ( ) && self . missing_glyph_substitute . is_some ( ) {
283- self . missing_glyph_substitute . unwrap ( )
284- } else {
281+ let glyph_c = if let Some ( substitute) = self . missing_glyph_substitute {
282+ if bdf. glyphs . get ( c) . is_some ( ) {
285283 c
286- } ;
284+ } else {
285+ substitute
286+ }
287+ } else {
288+ c
289+ } ;
287290
288291 bdf. glyphs
289292 . get ( glyph_c)
Original file line number Diff line number Diff line change 11use std:: path:: PathBuf ;
22
33use anyhow:: { anyhow, Context , Result } ;
4- use clap:: { command , Parser } ;
4+ use clap:: Parser ;
55use eg_font_converter:: FontConverter ;
66use embedded_graphics:: mono_font:: mapping:: Mapping ;
77
You can’t perform that action at this time.
0 commit comments