1
Fork 0

Move std::{str,vec}::raw::set_len to an unsafe method on Owned{Vector,Str}.

This commit is contained in:
Huon Wilson 2013-12-15 23:05:30 +11:00
parent 4f62c969f6
commit f53292f7ee
11 changed files with 68 additions and 66 deletions

View file

@ -523,7 +523,7 @@ pub trait Reader {
let mut total_read = 0;
buf.reserve_additional(len);
vec::raw::set_len(buf, start_len + len);
buf.set_len(start_len + len);
(|| {
while total_read < len {
@ -539,7 +539,7 @@ pub trait Reader {
}
}
}
}).finally(|| vec::raw::set_len(buf, start_len + total_read))
}).finally(|| buf.set_len(start_len + total_read))
}
}