From fb6b970bf8d12182a69b1e7ae222f3e2ebbb9003 Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Thu, 5 Feb 2015 13:53:32 +0200 Subject: [PATCH] Replace one more slice::from_raw_mut_buf added with new io --- src/libstd/io/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 0832206a48b..419bee1a624 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -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; @@ -69,8 +68,8 @@ fn with_end_to_cap(v: &mut Vec, f: F) -> Result 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