summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/eco.rs12
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())