1
Fork 0

core: deny(vecs_implicity_copyable)

This commit is contained in:
Brian Anderson 2012-09-02 15:37:15 -07:00
parent 7fb1a4e2d1
commit 087c5032a8
12 changed files with 37 additions and 27 deletions

View file

@ -605,7 +605,7 @@ pure fn lines(s: &str) -> ~[~str] { split_char(s, '\n') }
pure fn lines_any(s: &str) -> ~[~str] {
vec::map(lines(s), |s| {
let l = len(s);
let mut cp = s;
let mut cp = copy s;
if l > 0u && s[l - 1u] == '\r' as u8 {
unsafe { unsafe::set_len(cp, l - 1u); }
}
@ -2068,7 +2068,7 @@ impl ~str: UniqueStr {
impl ~str: add<&str,~str> {
#[inline(always)]
pure fn add(rhs: &str) -> ~str {
append(self, rhs)
append(copy self, rhs)
}
}