Skip to content

Commit

Permalink
fix(wm): remove panic on missing matching strategy
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
LGUG2Z committed Nov 3, 2024
1 parent 6a09ec4 commit 24b43a1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions komorebi/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 24b43a1

Please sign in to comment.