diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/strbuf.rs | 7 |
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()) } } |
