chore: fixing linter warnings

This commit is contained in:
danieleades 2023-11-28 19:02:08 +00:00 committed by GitHub
parent ebcfa5f2d0
commit 8e99406a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 79 additions and 75 deletions

View file

@ -48,10 +48,10 @@ where
let num = self.model.items.len();
if num != 0 {
let spacing = f32::from(self.spacing);
bounds.width = (bounds.width - (num as f32 * spacing) + spacing) / num as f32;
bounds.width = ((num as f32).mul_add(-spacing, bounds.width) + spacing) / num as f32;
if nth != 0 {
bounds.x += (nth as f32 * bounds.width) + (nth as f32 * spacing);
bounds.x += (nth as f32).mul_add(bounds.width, nth as f32 * spacing);
}
}
@ -69,7 +69,7 @@ where
let spacing = f32::from(self.spacing);
if num != 0 {
width = (num as f32 * width) + (num as f32 * spacing) - spacing;
width = (num as f32).mul_add(width, num as f32 * spacing) - spacing;
}
let size = limits

View file

@ -183,7 +183,7 @@ where
self.storage
.0
.entry(TypeId::of::<Data>())
.or_insert_with(SecondaryMap::new)
.or_default()
.insert(id, Box::new(data));
}
}
@ -297,7 +297,7 @@ where
}
pub fn indent(&self, id: Entity) -> Option<u16> {
self.indents.get(id).map(|indent| *indent)
self.indents.get(id).copied()
}
pub fn indent_set(&mut self, id: Entity, indent: u16) -> Option<u16> {