impl Clone for ~T, ~[T], ~str
This commit is contained in:
parent
2b059c6e56
commit
748c2c9ebc
7 changed files with 51 additions and 25 deletions
|
@ -20,6 +20,7 @@
|
|||
use at_vec;
|
||||
use cast;
|
||||
use char;
|
||||
use clone::Clone;
|
||||
use cmp::{Equiv, TotalOrd, Ordering, Less, Equal, Greater};
|
||||
use libc;
|
||||
use option::{None, Option, Some};
|
||||
|
@ -2433,6 +2434,13 @@ impl OwnedStr for ~str {
|
|||
}
|
||||
}
|
||||
|
||||
impl Clone for ~str {
|
||||
#[inline(always)]
|
||||
fn clone(&self) -> ~str {
|
||||
self.to_str() // hilarious
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use char;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue