chore: clippy

This commit is contained in:
Vukašin Vojinović 2025-10-16 13:50:32 +02:00 committed by Victoria Brekenfeld
parent 3b70bc0265
commit 0847247c33
77 changed files with 865 additions and 1029 deletions

View file

@ -37,8 +37,7 @@ mod handlers;
pub fn head_is_enabled(output: &Output) -> bool {
output
.user_data()
.get::<OutputState>()
.map_or(false, |inner| inner.lock().unwrap().enabled)
.get::<OutputState>().is_some_and(|inner| inner.lock().unwrap().enabled)
}
#[derive(Debug)]
@ -135,7 +134,7 @@ impl<'a> TryFrom<&'a mut PendingOutputConfigurationInner> for OutputConfiguratio
wlr_mode
.data::<Mode>()
.cloned()
.ok_or_else(|| zwlr_output_configuration_head_v1::Error::InvalidMode)?,
.ok_or(zwlr_output_configuration_head_v1::Error::InvalidMode)?,
)),
Some(ModeConfiguration::Custom { size, refresh }) => {
Some(ModeConfiguration::Custom { size, refresh })
@ -283,7 +282,7 @@ where
for instance in &mut self.instances {
let mut removed_heads = Vec::new();
for head in &mut instance.heads {
if &head.output == &output {
if head.output == output {
if head.obj.version() < zwlr_output_head_v1::REQ_RELEASE_SINCE {
removed_heads.push(head.obj.clone());
}
@ -435,7 +434,7 @@ where
.map(|c| c == output_mode)
.unwrap_or(false)
{
instance.obj.current_mode(&*mode);
instance.obj.current_mode(mode);
}
}
}