core: Trait-ify various overloaded operators
This commit is contained in:
parent
b6aadf56c8
commit
01e2471cb7
7 changed files with 55 additions and 5 deletions
|
@ -1897,7 +1897,6 @@ trait unique_str {
|
|||
fn trim() -> self;
|
||||
fn trim_left() -> self;
|
||||
fn trim_right() -> self;
|
||||
pure fn +(rhs: &str) -> self;
|
||||
}
|
||||
|
||||
/// Extension methods for strings
|
||||
|
@ -1919,6 +1918,13 @@ impl extensions of unique_str for ~str {
|
|||
}
|
||||
}
|
||||
|
||||
impl extensions of ops::add<&str,~str> for ~str {
|
||||
#[inline(always)]
|
||||
pure fn add(rhs: &str) -> ~str {
|
||||
append(self, rhs)
|
||||
}
|
||||
}
|
||||
|
||||
trait str_slice {
|
||||
fn all(it: fn(char) -> bool) -> bool;
|
||||
fn any(it: fn(char) -> bool) -> bool;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue