From cbbb8235fab45be22df1e7b8d9d4cbd73f8d3564 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 19 Oct 2023 16:43:08 +0100 Subject: [PATCH] Minor cleanups --- src/table.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/table.rs b/src/table.rs index 165ad1644..239b52b9b 100644 --- a/src/table.rs +++ b/src/table.rs @@ -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 @@ -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 @@ -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 /// /// ```