summary refs log tree commit diff
path: root/src/libcore/str.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-03-05 12:12:50 -0800
committerbors <bors@rust-lang.org>2013-03-05 12:12:50 -0800
commitdec599f652dbafe9a4f5ec6ba63023d1eae89a08 (patch)
tree837f83c1a505cf0c091b3face81eb78120e8288a /src/libcore/str.rs
parent4c8e12ea97916b15f14faeac74cd5bee1789f9ac (diff)
parent2fa2ad59958d0028c856fb68359edb9a7bd9cab8 (diff)
downloadrust-dec599f652dbafe9a4f5ec6ba63023d1eae89a08.tar.gz
rust-dec599f652dbafe9a4f5ec6ba63023d1eae89a08.zip
auto merge of #5234 : pcwalton/rust/equiv, r=pcwalton
r? @nikomatsakis 
Diffstat (limited to 'src/libcore/str.rs')
-rw-r--r--src/libcore/str.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 892956e285e..19453c5e96f 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -20,7 +20,7 @@
 use at_vec;
 use cast;
 use char;
-use cmp::{TotalOrd, Ordering, Less, Equal, Greater};
+use cmp::{Equiv, TotalOrd, Ordering, Less, Equal, Greater};
 use libc;
 use option::{None, Option, Some};
 use ptr;
@@ -898,6 +898,12 @@ impl Ord for @str {
     pure fn gt(&self, other: &@str) -> bool { gt((*self), (*other)) }
 }
 
+#[cfg(notest)]
+impl Equiv<~str> for &str {
+    #[inline(always)]
+    pure fn equiv(&self, other: &~str) -> bool { eq_slice(*self, *other) }
+}
+
 /*
 Section: Iterating through strings
 */