about summary refs log tree commit diff
path: root/src/libstd/str.rs
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-12-18 02:13:20 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2013-12-19 10:18:02 +1100
commit9177f7ecb4d897a72aeaa0b3dfed930286946cf3 (patch)
tree8a2eb18e41f2d4262e2ed32f30e614aee567e72e /src/libstd/str.rs
parent4c79b22ef26a2b846d84c46bc8fea50c953559dd (diff)
downloadrust-9177f7ecb4d897a72aeaa0b3dfed930286946cf3.tar.gz
rust-9177f7ecb4d897a72aeaa0b3dfed930286946cf3.zip
std::vec: remove .as_muf_buf, replaced by .as_mut_ptr & .len.
Diffstat (limited to 'src/libstd/str.rs')
-rw-r--r--src/libstd/str.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/str.rs b/src/libstd/str.rs
index e785ed74159..d564c55fb60 100644
--- a/src/libstd/str.rs
+++ b/src/libstd/str.rs
@@ -1000,7 +1000,7 @@ pub mod raw {
     /// Create a Rust string from a *u8 buffer of the given length
     pub unsafe fn from_buf_len(buf: *u8, len: uint) -> ~str {
         let mut v: ~[u8] = vec::with_capacity(len);
-        v.as_mut_buf(|vbuf, _len| ptr::copy_memory(vbuf, buf as *u8, len));
+        ptr::copy_memory(v.as_mut_ptr(), buf as *u8, len);
         v.set_len(len);
 
         assert!(is_utf8(v));
@@ -2282,7 +2282,7 @@ impl<'a> StrSlice<'a> for &'a str {
             unsafe {
                 let mut v = vec::with_capacity(len);
 
-                v.as_mut_buf(|dst, _| ptr::copy_memory(dst, src, len));
+                ptr::copy_memory(v.as_mut_ptr(), src, len);
                 v.set_len(len);
                 ::cast::transmute(v)
             }
@@ -2697,7 +2697,8 @@ impl OwnedStr for ~str {
     #[inline]
     fn as_mut_buf<T>(&mut self, f: |*mut u8, uint| -> T) -> T {
         unsafe {
-            raw::as_owned_vec(self).as_mut_buf(f)
+            let v = raw::as_owned_vec(self);
+            f(v.as_mut_ptr(), v.len())
         }
     }