Skip to content

Commit

Permalink
Make ptr_eq public
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurprs committed Aug 8, 2023
1 parent 9697167 commit 359654a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/map/hash_trie_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ where
///
/// This would return true if you’re comparing a map to itself,
/// or if you’re comparing a map to a fresh clone of itself.
pub(crate) fn ptr_eq<PO: SharedPointerKind, HO: BuildHasher>(
pub fn ptr_eq<PO: SharedPointerKind, HO: BuildHasher>(
&self,
other: &HashTrieMap<K, V, PO, HO>,
) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/map/red_black_tree_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ where
///
/// This would return true if you’re comparing a map to itself,
/// or if you’re comparing a map to a fresh clone of itself.
pub(crate) fn ptr_eq<PO: SharedPointerKind>(&self, other: &RedBlackTreeMap<K, V, PO>) -> bool {
pub fn ptr_eq<PO: SharedPointerKind>(&self, other: &RedBlackTreeMap<K, V, PO>) -> bool {
let a = self.root.as_ref().map_or(core::ptr::null(), SharedPointer::as_ptr);
// Note how we're casting the raw pointer changing from P to PO
// We cannot perform the equality in a type safe way because the root type depends
Expand Down
2 changes: 1 addition & 1 deletion src/set/hash_trie_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ where
///
/// This would return true if you’re comparing a set to itself,
/// or if you’re comparing a set to a fresh clone of itself.
fn ptr_eq<PO: SharedPointerKind, HO: BuildHasher + Clone>(
pub fn ptr_eq<PO: SharedPointerKind, HO: BuildHasher + Clone>(
&self,
other: &HashTrieSet<T, PO, HO>,
) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/set/red_black_tree_set/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ where
///
/// This would return true if you’re comparing a set to itself,
/// or if you’re comparing a set to a fresh clone of itself.
fn ptr_eq<PO: SharedPointerKind>(&self, other: &RedBlackTreeSet<T, PO>) -> bool {
pub fn ptr_eq<PO: SharedPointerKind>(&self, other: &RedBlackTreeSet<T, PO>) -> bool {
self.map.ptr_eq(&other.map)
}

Expand Down

0 comments on commit 359654a

Please sign in to comment.