Skip to content

Commit

Permalink
Replace one more slice::from_raw_mut_buf added with new io
Browse files Browse the repository at this point in the history
  • Loading branch information
mzabaluev committed Feb 5, 2015
1 parent 3ac8628 commit fb6b970
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libstd/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use error::Error as StdError;
use fmt;
use iter::Iterator;
use marker::Sized;
use mem;
use ops::{Drop, FnOnce};
use option::Option::{self, Some, None};
use ptr::PtrExt;
Expand Down Expand Up @@ -69,8 +68,8 @@ fn with_end_to_cap<F>(v: &mut Vec<u8>, f: F) -> Result<usize>
unsafe {
let n = try!(f({
let base = v.as_mut_ptr().offset(v.len() as isize);
black_box(slice::from_raw_mut_buf(mem::copy_lifetime(v, &base),
v.capacity() - v.len()))
black_box(slice::from_raw_parts_mut(base,
v.capacity() - v.len()))
}));

// If the closure (typically a `read` implementation) reported that it
Expand Down

0 comments on commit fb6b970

Please sign in to comment.