Skip to content

Commit bea5edb

Browse files
committed
Fix clippy warning
1 parent a52da7f commit bea5edb

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

bdf-parser/src/glyph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub struct Glyph {
6868
}
6969

7070
fn 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

eg-font-converter/src/lib.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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)

eg-font-converter/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::path::PathBuf;
22

33
use anyhow::{anyhow, Context, Result};
4-
use clap::{command, Parser};
4+
use clap::Parser;
55
use eg_font_converter::FontConverter;
66
use embedded_graphics::mono_font::mapping::Mapping;
77

0 commit comments

Comments
 (0)