From 24b43a154c49ef2499ce46402abcaa99ed6055b5 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sun, 3 Nov 2024 08:21:58 -0800 Subject: [PATCH] fix(wm): remove panic on missing matching strategy This commit ensures that if an IdWithIdentifer without an explicitly set matching strategy makes it through to should_act_individual, it will be treated the same as MatchingStrategy::Legacy instead of causing a runtime panic. --- komorebi/src/window.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/komorebi/src/window.rs b/komorebi/src/window.rs index 85aab22c..a39060d5 100644 --- a/komorebi/src/window.rs +++ b/komorebi/src/window.rs @@ -777,10 +777,7 @@ pub fn should_act_individual( let mut should_act = false; match identifier.matching_strategy { - None => { - panic!("there is no matching strategy identified for this rule"); - } - Some(MatchingStrategy::Legacy) => match identifier.kind { + None | Some(MatchingStrategy::Legacy) => match identifier.kind { ApplicationIdentifier::Title => { if title.starts_with(&identifier.id) || title.ends_with(&identifier.id) { should_act = true;