Skip to content

Commit 252a380

Browse files
committed
fix: do not compare references to pointers to compare pointers
`self` and `other` are references, and the `ptr::eq()` call intends to determine if they designate the same object. Putting them behind another level of reference will always return `false`, as those short-lived references will be compared instead.
1 parent b486867 commit 252a380

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tracing-core/src/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ impl Eq for Metadata<'_> {}
446446
impl PartialEq for Metadata<'_> {
447447
#[inline]
448448
fn eq(&self, other: &Self) -> bool {
449-
if core::ptr::eq(&self, &other) {
449+
if core::ptr::eq(self, other) {
450450
true
451451
} else if cfg!(not(debug_assertions)) {
452452
// In a well-behaving application, two `Metadata` can be assumed to

0 commit comments

Comments
 (0)