Skip to content

Commit

Permalink
fix eq on any-ref; tag 0.6.4-a5
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed May 18, 2024
1 parent 8efb4e8 commit 8d31149
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cirru_edn"
version = "0.6.4-a4"
version = "0.6.4-a5"
authors = ["jiyinyiyong <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down
10 changes: 5 additions & 5 deletions src/edn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,12 @@ unsafe impl Sync for EdnAnyRef {}

impl PartialEq for EdnAnyRef {
fn eq(&self, other: &Self) -> bool {
let a = &self.0.as_ptr();
let b = &other.0.as_ptr();
a == b
// unstable API not used yet
// std::ptr::addr_eq(a, b)
let a = self.0.as_ptr();
let b = other.0.as_ptr();
std::ptr::addr_eq(a, b)
}
}

impl Eq for EdnAnyRef {}

impl fmt::Display for Edn {
Expand Down Expand Up @@ -342,6 +341,7 @@ impl PartialEq for Edn {
(Self::Set(a), Self::Set(b)) => a == b,
(Self::Map(a), Self::Map(b)) => a == b,
(Self::Record(a), Self::Record(b)) => a == b,
(Self::AnyRef(a), Self::AnyRef(b)) => a == b,
(_, _) => false,
}
}
Expand Down

0 comments on commit 8d31149

Please sign in to comment.