more clippy

This commit is contained in:
galister
2025-10-31 17:48:54 +09:00
parent 67017a9f54
commit 44b9a79849
6 changed files with 31 additions and 28 deletions

View File

@@ -13,10 +13,7 @@ struct BarState {}
#[allow(clippy::significant_drop_tightening)]
#[allow(clippy::for_kv_map)] // TODO: remove later
#[allow(clippy::match_same_arms)] // TODO: remove later
pub fn create_bar<O>(app: &mut AppState) -> anyhow::Result<OverlayWindowConfig>
where
O: Default,
{
pub fn create_bar(app: &mut AppState) -> anyhow::Result<OverlayWindowConfig> {
let state = BarState {};
let mut panel = GuiPanel::new_from_template(app, "gui/bar.xml", state, None)?;

View File

@@ -356,17 +356,17 @@ fn create_overlay(
overlay.default_state.positioning = attach_to.get_positioning();
}
let rot = if let Some(rot) = &conf_display.rotation {
glam::Quat::from_axis_angle(Vec3::from_slice(&rot.axis), f32::to_radians(rot.angle))
} else {
glam::Quat::IDENTITY
};
let rot = conf_display
.rotation
.as_ref()
.map_or(glam::Quat::IDENTITY, |rot| {
glam::Quat::from_axis_angle(Vec3::from_slice(&rot.axis), f32::to_radians(rot.angle))
});
let pos = if let Some(pos) = &conf_display.pos {
Vec3::from_slice(pos)
} else {
Vec3::NEG_Z
};
let pos = conf_display
.pos
.as_ref()
.map_or(Vec3::NEG_Z, |pos| Vec3::from_slice(pos));
overlay.default_state.transform = Affine3A::from_rotation_translation(rot, pos);