Skip to content

Commit

Permalink
Fix and un-allow trivial_numeric_casts lints (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored Dec 17, 2024
1 parent a3cceb5 commit 0fd6b08
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fontique/src/backend/dwrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl DWriteSystemFonts {
.FindFamilyName(PCWSTR::from_raw(name_buf.as_ptr()), &mut index, &mut exists)
.ok()?;
}
self.get(index as _)
self.get(index)
}

fn families(&self) -> impl Iterator<Item = DWriteFontFamily> {
Expand Down
6 changes: 3 additions & 3 deletions fontique/src/backend/fontconfig/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ fn parse_font(
Object::Slant => {
for val in elt.values().ok()? {
if let Value::Int(i) = val.ok()? {
font.style = FontStyle::from_fontconfig(i as _);
font.style = FontStyle::from_fontconfig(i);
}
}
}
Object::Weight => {
for val in elt.values().ok()? {
if let Value::Int(i) = val.ok()? {
font.weight = FontWeight::from_fontconfig(i as _);
font.weight = FontWeight::from_fontconfig(i);
}
}
}
Object::Width => {
for val in elt.values().ok()? {
if let Value::Int(i) = val.ok()? {
font.width = FontWidth::from_fontconfig(i as _);
font.width = FontWidth::from_fontconfig(i);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion fontique/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#![allow(missing_debug_implementations)]
#![allow(missing_docs)]
#![allow(single_use_lifetimes)]
#![allow(trivial_numeric_casts)]
#![allow(unnameable_types)]
#![allow(unreachable_pub)]
#![allow(clippy::cast_possible_truncation)]
Expand Down
2 changes: 1 addition & 1 deletion parley/src/layout/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ impl Selection {
} else {
if cur_x != start_x {
let width = (cur_x - start_x).max(MIN_RECT_WIDTH);
f(Rect::new(start_x as _, line_min, start_x + width, line_max));
f(Rect::new(start_x, line_min, start_x + width, line_max));
}
cur_x += advance;
start_x = cur_x;
Expand Down
1 change: 0 additions & 1 deletion parley/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
#![allow(missing_debug_implementations)]
#![allow(missing_docs)]
#![allow(single_use_lifetimes)]
#![allow(trivial_numeric_casts)]
#![allow(unnameable_types)]
#![allow(clippy::cast_possible_truncation)]
#![allow(clippy::exhaustive_enums)]
Expand Down

0 comments on commit 0fd6b08

Please sign in to comment.