From 3f70b24b0e5db127e3c8eab70134a96ac0b5f7af Mon Sep 17 00:00:00 2001 From: Oleksii Shmalko Date: Wed, 15 May 2024 14:45:53 +0300 Subject: [PATCH] chore: dump MSRV to 1.65.0 by removing usage of .is_some_and() --- Cargo.toml | 2 +- src/eval.rs | 4 ++-- src/rules.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index abb3e0c0..c01c41fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] } diff --git a/src/eval.rs b/src/eval.rs index 8b0b40dc..9fa6569c 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -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 } diff --git a/src/rules.rs b/src/rules.rs index d21a0655..5af99699 100644 --- a/src/rules.rs +++ b/src/rules.rs @@ -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),