clippy: clean up all warnings

Mostly `cargo clippy --fix`: needless borrows, redundant field names,
match -> if let, io::Error::other, Option::filter/map, let chains, c""
literals. By hand: drop unused impl lifetimes, a type alias for the
font preload map, Iterator::find in next_buffer, contains_key, and
allow new_ret_no_self where constructors intentionally return the
boxed/generic wrapper type.

No functional change; tests and release build unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Bendik Aagaard Lynghaug
2026-10-03 09:20:25 +00:00
co-authored by Claude Fable 5.1
parent 42ffe9c492
commit 1c6a536026
20 changed files with 153 additions and 190 deletions
+10 -16
View File
@@ -69,7 +69,7 @@ impl Calendar {
fn draw_month(
&mut self,
fonts: &mut FontMap,
mut view: &mut BufferView,
view: &mut BufferView,
orig: NaiveDate,
mut time: NaiveDate,
) {
@@ -100,7 +100,7 @@ impl Calendar {
+ (self.size * DAY_FACTOR * 0.2).ceil() as u32,
)),
c,
&wk_chr,
wk_chr,
)
.unwrap();
}
@@ -124,9 +124,7 @@ impl Calendar {
12 => "December",
_ => panic!("impossible value"),
};
month_font
.draw_text(&mut view, Color::WHITE, month_str)
.unwrap();
month_font.draw_text(view, Color::WHITE, month_str).unwrap();
//
// Draw the year
@@ -199,7 +197,7 @@ impl Calendar {
}
}
impl<'a> Widget for Calendar {
impl Widget for Calendar {
fn get_dirty(&self) -> bool {
self.dirty
}
@@ -209,11 +207,8 @@ impl<'a> Widget for Calendar {
}
fn event(&mut self, event: &Event) {
match event {
Event::NewMinute => {
self.dirty = true;
}
_ => (),
if let Event::NewMinute = event {
self.dirty = true;
}
}
@@ -299,9 +294,8 @@ impl<'a> Widget for Calendar {
self.geometry = Geometry {
x: geometry.x,
y: geometry.y,
width: cal_width * self.shown_sections_x as u32
+ cal_pad * (self.shown_sections_x as u32 - 1),
height: cal_height * self.shown_sections_y as u32,
width: cal_width * self.shown_sections_x + cal_pad * (self.shown_sections_x - 1),
height: cal_height * self.shown_sections_y,
};
self.geometry
}
@@ -344,8 +338,8 @@ impl<'a> Widget for Calendar {
Geometry {
x: 0,
y: 0,
width: width,
height: height,
width,
height,
}
}
}