Skip to content

Commit

Permalink
fix: Autofixed suggestions by clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
max-ishere committed Feb 7, 2024
1 parent adedad4 commit 5464d06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parser/pff2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -302,7 +302,7 @@ impl Parser {
impl<T: FontValidation> Pff2<T> {
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()
}
Expand Down

0 comments on commit 5464d06

Please sign in to comment.