Skip to content

Commit

Permalink
Merge pull request #81 from thomasheartman/main
Browse files Browse the repository at this point in the history
chore: extract complex match block into a variable (clippy suggestion)
  • Loading branch information
thomasheartman authored Mar 14, 2024
2 parents a8a45f7 + 26eaac3 commit ebae633
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ where
let default_context = &Default::default();
let context = context.unwrap_or(default_context);

match (|| {
let feature_enabled = {
if feature.strategies.is_empty() && feature.known && !feature.feature_disabled {
trace!(
"is_enabled: feature {:?} has no strategies: enabling",
Expand Down Expand Up @@ -307,15 +307,14 @@ where
);
false
}
})() {
true => {
feature.enabled.fetch_add(1, Ordering::Relaxed);
true
}
false => {
feature.disabled.fetch_add(1, Ordering::Relaxed);
false
}
};

if feature_enabled {
feature.enabled.fetch_add(1, Ordering::Relaxed);
true
} else {
feature.disabled.fetch_add(1, Ordering::Relaxed);
false
}
}

Expand Down

0 comments on commit ebae633

Please sign in to comment.