Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ptr_eq public #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -854,7 +854,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