refactor: pedantic cargo clippy, do not use Results for always-succeeding functions

This commit is contained in:
Aleksander
2025-08-16 21:27:47 +02:00
parent 1f8960033c
commit 481db7f23c
45 changed files with 320 additions and 310 deletions

View File

@@ -24,7 +24,7 @@ pub struct WidgetSprite {
}
impl WidgetSprite {
pub fn create(params: WidgetSpriteParams) -> anyhow::Result<WidgetState> {
pub fn create(params: WidgetSpriteParams) -> WidgetState {
WidgetState::new(Box::new(Self { params }))
}
}
@@ -44,8 +44,7 @@ impl WidgetObj for WidgetSprite {
self
.params
.color
.map(|c| c.into())
.unwrap_or(cosmic_text::Color::rgb(255, 255, 255)),
.map_or(cosmic_text::Color::rgb(255, 255, 255), Into::into),
),
snap_to_physical_pixel: true,
};
@@ -76,7 +75,7 @@ impl WidgetObj for WidgetSprite {
payload: drawing::PrimitivePayload::Text(Rc::new(RefCell::new(buffer))),
transform: state.transform_stack.get().transform,
});
};
}
}
fn measure(