1
Fork 0

auto merge of #5234 : pcwalton/rust/equiv, r=pcwalton

r? @nikomatsakis
This commit is contained in:
bors 2013-03-05 12:12:50 -08:00
commit dec599f652
24 changed files with 111 additions and 28 deletions

View file

@ -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
*/