diff --git a/plugins/window-state/src/lib.rs b/plugins/window-state/src/lib.rs index ba199f20..20e7d943 100644 --- a/plugins/window-state/src/lib.rs +++ b/plugins/window-state/src/lib.rs @@ -212,7 +212,7 @@ impl WindowExt for Window { metadata.fullscreen = self.is_fullscreen()?; } - c.insert(key.into(), metadata); + c.insert(key, metadata); } if flags.contains(StateFlags::VISIBLE) && should_show { @@ -296,11 +296,9 @@ impl Group { } /// get group name which match first rule -pub fn group_name(groups: &Vec, label: String) -> String { +pub fn group_name(groups: &[Group], label: String) -> String { groups - .iter() - .filter(|g| g.filter(&label)) - .nth(0) + .iter().find(|g| g.filter(&label)) .map_or(label, |g| g.name.clone()) }