diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-01-31 19:29:01 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-01-31 19:29:01 +0100 |
| commit | f72c81a7571888251e23999dcdc3daf7d567d7bf (patch) | |
| tree | 8806a62da981436d293af8ea06cecfe12389fa96 /src/util | |
| parent | ec05ed7e0646d1e8ff76677d0332ddf93ed57b69 (diff) | |
More `PartialEq` impls for `EcoString`
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/eco.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util/eco.rs b/src/util/eco.rs index dccb68a8..ceaac2f5 100644 --- a/src/util/eco.rs +++ b/src/util/eco.rs @@ -262,6 +262,18 @@ impl PartialEq<&str> for EcoString { } } +impl PartialEq<EcoString> for str { + fn eq(&self, other: &EcoString) -> bool { + self.eq(other.as_str()) + } +} + +impl PartialEq<EcoString> for &str { + fn eq(&self, other: &EcoString) -> bool { + (*self).eq(other.as_str()) + } +} + impl Ord for EcoString { fn cmp(&self, other: &Self) -> Ordering { self.as_str().cmp(other.as_str()) |
