Clippy Fixes

This commit is contained in:
Andrew Wheeler(Genusis) 2022-10-25 10:43:38 -04:00 committed by Jeremy Soller
parent e39f8eabd5
commit 5200f67196
5 changed files with 61 additions and 62 deletions

View file

@ -10,7 +10,12 @@ pub struct CacheKey {
}
impl CacheKey {
pub fn new(font_id: fontdb::ID, glyph_id: u16, font_size: i32, pos: (f32, f32)) -> (Self, i32, i32) {
pub fn new(
font_id: fontdb::ID,
glyph_id: u16,
font_size: i32,
pos: (f32, f32),
) -> (Self, i32, i32) {
let (x, x_bin) = SubpixelBin::new(pos.0);
let (y, y_bin) = SubpixelBin::new(pos.1);
(
@ -54,6 +59,7 @@ impl SubpixelBin {
(trunc - 1, Self::Zero)
}
} else {
#[allow(clippy::collapsible_else_if)]
if fract < 0.125 {
(trunc, Self::Zero)
} else if fract < 0.375 {