Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Oct 19, 2023
1 parent 878b5bf commit cbbb823
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,7 @@ where
/// # }
/// ```
pub fn find(&self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option<&T> {
self.raw
.find(hash, eq)
.map(|bucket| unsafe { bucket.as_ref() })
self.raw.get(hash, eq)
}

/// Returns a mutable reference to an entry in the table with the given hash
Expand Down Expand Up @@ -263,9 +261,7 @@ where
/// # }
/// ```
pub fn find_mut(&mut self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option<&mut T> {
self.raw
.find(hash, eq)
.map(|bucket| unsafe { bucket.as_mut() })
self.raw.get_mut(hash, eq)
}

/// Returns an `OccupiedEntry` for an entry in the table with the given hash
Expand Down Expand Up @@ -1788,6 +1784,7 @@ where
/// type will be removed.
///
/// [limitations]: https://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-based-borrow-check-nll-status-update/#polonius
///
/// # Examples
///
/// ```
Expand Down

0 comments on commit cbbb823

Please sign in to comment.