diff --git a/crates/ruff_python_ast/src/name.rs b/crates/ruff_python_ast/src/name.rs index 585a9c88ed..5df673b54b 100644 --- a/crates/ruff_python_ast/src/name.rs +++ b/crates/ruff_python_ast/src/name.rs @@ -179,7 +179,7 @@ impl salsa::HashEqLike<&str> for Name { #[inline] fn eq(&self, data: &&str) -> bool { - self.as_str() == *data + self == *data } } @@ -261,7 +261,7 @@ impl std::fmt::Display for Name { impl PartialEq for Name { #[inline] fn eq(&self, other: &str) -> bool { - self.as_str() == other + self.0 == other } } @@ -275,7 +275,7 @@ impl PartialEq for str { impl PartialEq<&str> for Name { #[inline] fn eq(&self, other: &&str) -> bool { - self.as_str() == *other + self.0 == *other } } @@ -302,7 +302,7 @@ impl PartialEq for String { impl PartialEq<&String> for Name { #[inline] fn eq(&self, other: &&String) -> bool { - self.as_str() == *other + self == other.as_str() } }