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.
This commit is contained in:
LGUG2Z
2024-11-03 08:21:58 -08:00
parent 6a09ec4b87
commit 24b43a154c

View File

@@ -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;