diff --git a/foyer-common/Cargo.toml b/foyer-common/Cargo.toml index 475322f2..2dbc113f 100644 --- a/foyer-common/Cargo.toml +++ b/foyer-common/Cargo.toml @@ -19,6 +19,7 @@ hashbrown = "0.14" itertools = "0.12" nix = { version = "0.28", features = ["fs"] } parking_lot = { version = "0.12", features = ["arc_lock"] } +rustversion = "1.0" serde = { workspace = true } tokio = { workspace = true } diff --git a/foyer-common/src/range.rs b/foyer-common/src/range.rs index ffc9c2bb..eee162b6 100644 --- a/foyer-common/src/range.rs +++ b/foyer-common/src/range.rs @@ -103,13 +103,13 @@ pub trait RangeBoundsExt< self.start_bound() == Bound::Unbounded && self.end_bound() == Bound::Unbounded } - // TODO(Mrcroxx): Restore me after increase MSRV to 1.77.2 - // fn map(&self, f: F) -> (Bound, Bound) - // where - // F: Fn(&T) -> R, - // { - // (self.start_bound().map(&f), self.end_bound().map(&f)) - // } + #[rustversion::since(1.77.2)] + fn map(&self, f: F) -> (Bound, Bound) + where + F: Fn(&T) -> R, + { + (self.start_bound().map(&f), self.end_bound().map(&f)) + } } impl<