From f27392c3ef5ce68a43f8f3b5ac01d2f836d496a5 Mon Sep 17 00:00:00 2001 From: luohy Date: Mon, 7 Aug 2023 13:49:57 +0800 Subject: [PATCH] fix(window-state): fix warning --- plugins/window-state/src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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()) }