Skip to content

Commit

Permalink
chore: dump MSRV to 1.65.0 by removing usage of .is_some_and()
Browse files Browse the repository at this point in the history
  • Loading branch information
rasendubi committed May 15, 2024
1 parent 6835673 commit 3f70b24
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/Eppo-exp/rust-sdk"
license = "MIT"
keywords = ["eppo", "feature-flags"]
categories = ["config"]
rust-version = "1.70.0"
rust-version = "1.65.0"

[dependencies]
chrono = { version = "0.4.38", features = ["serde"] }
Expand Down
4 changes: 2 additions & 2 deletions src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ impl Allocation {
}

fn is_allowed_by_time(&self, now: Timestamp) -> bool {
let forbidden =
self.start_at.is_some_and(|t| now < t) || self.end_at.is_some_and(|t| now > t);
let forbidden = matches!(self.start_at, Some(t) if now < t)
|| matches!(self.end_at, Some(t) if now > t);
!forbidden
}

Expand Down
2 changes: 1 addition & 1 deletion src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Operator {

Self::IsNull => {
let is_null =
attribute.is_none() || attribute.is_some_and(|v| v == &AttributeValue::Null);
attribute.is_none() || matches!(attribute, Some(&AttributeValue::Null));
match condition_value {
ConditionValue::Single(Value::Boolean(true)) => Some(is_null),
ConditionValue::Single(Value::Boolean(false)) => Some(!is_null),
Expand Down

0 comments on commit 3f70b24

Please sign in to comment.