about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2014-05-03 21:41:58 -0700
committerKevin Ballard <kevin@sb.org>2014-05-08 12:06:21 -0700
commitbbc35eada991b3256812598a555b1ef442d29c15 (patch)
treeb2fe20f2941d0e2227470472d859b81ff7f1c463 /src/libstd
parent44e8021b590bde58475eee8c50a21f1cb96f57e7 (diff)
downloadrust-bbc35eada991b3256812598a555b1ef442d29c15.tar.gz
rust-bbc35eada991b3256812598a555b1ef442d29c15.zip
Handle fallout in std::strbuf
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/strbuf.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libstd/strbuf.rs b/src/libstd/strbuf.rs
index ad703b8054b..8e05b2f527d 100644
--- a/src/libstd/strbuf.rs
+++ b/src/libstd/strbuf.rs
@@ -19,7 +19,7 @@ use io::Writer;
 use iter::{Extendable, FromIterator, Iterator, range};
 use option::{None, Option, Some};
 use ptr::RawPtr;
-use slice::{OwnedVector, Vector};
+use slice::{OwnedVector, Vector, CloneableVector};
 use str::{OwnedStr, Str, StrSlice, StrAllocating};
 use str;
 use vec::Vec;
@@ -273,11 +273,8 @@ impl Str for StrBuf {
 impl StrAllocating for StrBuf {
     #[inline]
     fn into_owned(self) -> ~str {
-        let StrBuf {
-            vec: vec
-        } = self;
         unsafe {
-            cast::transmute::<~[u8],~str>(vec.move_iter().collect())
+            cast::transmute(self.vec.as_slice().to_owned())
         }
     }