From 5464d067c2ed3e054f8c402df43706f166cc44e9 Mon Sep 17 00:00:00 2001 From: max-ishere <47008271+max-ishere@users.noreply.github.com> Date: Wed, 7 Feb 2024 22:16:11 +0200 Subject: [PATCH] fix: Autofixed suggestions by clippy --- src/parser/pff2.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser/pff2.rs b/src/parser/pff2.rs index 3a345d1..7cab8a8 100644 --- a/src/parser/pff2.rs +++ b/src/parser/pff2.rs @@ -271,10 +271,10 @@ impl Parser { return Err(E::NoGlyphs); } - let mut last_codepoint = self.glyphs[0].code as u32; + let mut last_codepoint = self.glyphs[0].code; for Glyph { code, .. } in &self.glyphs[1..] { - let code = *code as u32; + let code = *code; if code > last_codepoint { last_codepoint = code; @@ -302,7 +302,7 @@ impl Parser { impl Pff2 { pub fn glyph(&self, c: u32) -> Option<&Glyph> { self.glyphs - .binary_search_by(|g| (g.code as u32).cmp(&(c as u32))) + .binary_search_by(|g| g.code.cmp(&{ c })) .map(|i| &self.glyphs[i]) .ok() }