Move std::{str,vec}::raw::set_len to an unsafe method on Owned{Vector,Str}.
This commit is contained in:
parent
4f62c969f6
commit
f53292f7ee
11 changed files with 68 additions and 66 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue