diff --git a/crates/ruma-identifiers/src/macros.rs b/crates/ruma-identifiers/src/macros.rs index 8fe87c49..676f57ad 100644 --- a/crates/ruma-identifiers/src/macros.rs +++ b/crates/ruma-identifiers/src/macros.rs @@ -235,6 +235,30 @@ macro_rules! opaque_identifier_common_impls { } } + impl PartialEq<$id> for Box<$id> { + fn eq(&self, other: &$id) -> bool { + self.as_str() == other.as_str() + } + } + + impl PartialEq<&'_ $id> for Box<$id> { + fn eq(&self, other: &&$id) -> bool { + self.as_str() == other.as_str() + } + } + + impl PartialEq> for $id { + fn eq(&self, other: &Box<$id>) -> bool { + self.as_str() == other.as_str() + } + } + + impl PartialEq> for &'_ $id { + fn eq(&self, other: &Box<$id>) -> bool { + self.as_str() == other.as_str() + } + } + as_str_based_impls!($id); partial_eq_string!($id); partial_eq_string!(Box<$id>);