diff options
| author | bors <bors@rust-lang.org> | 2013-03-15 20:15:44 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-03-15 20:15:44 -0700 |
| commit | 6f1e8ef71abb390a8f6406292ea06c729dcbf9e5 (patch) | |
| tree | eacbc64a864bd47298bdf1f2e678f096b1ea02b6 /src/libcore/str.rs | |
| parent | 5a77a1048897a12c9031d3e0b3867f0c6e3673ea (diff) | |
| parent | ee5842494a9170d6e1079a671695fcfc32ceb920 (diff) | |
| download | rust-6f1e8ef71abb390a8f6406292ea06c729dcbf9e5.tar.gz rust-6f1e8ef71abb390a8f6406292ea06c729dcbf9e5.zip | |
auto merge of #5404 : bstrie/rust/decopy, r=pcwalton
Also turn `copy` into `.clone()` in much of run-pass.
Diffstat (limited to 'src/libcore/str.rs')
| -rw-r--r-- | src/libcore/str.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 430ed2d9e38..23b14e243b8 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -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}; @@ -2436,6 +2437,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; |
