Replace one more slice::from_raw_mut_buf added with new io
This commit is contained in:
parent
3ac862816f
commit
fb6b970bf8
1 changed files with 2 additions and 3 deletions
|
@ -24,7 +24,6 @@ use error::Error as StdError;
|
||||||
use fmt;
|
use fmt;
|
||||||
use iter::Iterator;
|
use iter::Iterator;
|
||||||
use marker::Sized;
|
use marker::Sized;
|
||||||
use mem;
|
|
||||||
use ops::{Drop, FnOnce};
|
use ops::{Drop, FnOnce};
|
||||||
use option::Option::{self, Some, None};
|
use option::Option::{self, Some, None};
|
||||||
use ptr::PtrExt;
|
use ptr::PtrExt;
|
||||||
|
@ -69,8 +68,8 @@ fn with_end_to_cap<F>(v: &mut Vec<u8>, f: F) -> Result<usize>
|
||||||
unsafe {
|
unsafe {
|
||||||
let n = try!(f({
|
let n = try!(f({
|
||||||
let base = v.as_mut_ptr().offset(v.len() as isize);
|
let base = v.as_mut_ptr().offset(v.len() as isize);
|
||||||
black_box(slice::from_raw_mut_buf(mem::copy_lifetime(v, &base),
|
black_box(slice::from_raw_parts_mut(base,
|
||||||
v.capacity() - v.len()))
|
v.capacity() - v.len()))
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// If the closure (typically a `read` implementation) reported that it
|
// If the closure (typically a `read` implementation) reported that it
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue