Skip to content

Commit

Permalink
refactor: restore bound map with cfg (#445)
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <mrcroxx@outlook.com>
  • Loading branch information
MrCroxx committed Apr 28, 2024
1 parent 44a10ef commit 7cac4a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions foyer-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
14 changes: 7 additions & 7 deletions foyer-common/src/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<F, R>(&self, f: F) -> (Bound<R>, Bound<R>)
// where
// F: Fn(&T) -> R,
// {
// (self.start_bound().map(&f), self.end_bound().map(&f))
// }
#[rustversion::since(1.77.2)]
fn map<F, R>(&self, f: F) -> (Bound<R>, Bound<R>)
where
F: Fn(&T) -> R,
{
(self.start_bound().map(&f), self.end_bound().map(&f))
}
}

impl<
Expand Down

0 comments on commit 7cac4a7

Please sign in to comment.