Skip to content

Commit bbc35ea

Browse files
committed
Handle fallout in std::strbuf
1 parent 44e8021 commit bbc35ea

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/libstd/strbuf.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use io::Writer;
1919
use iter::{Extendable, FromIterator, Iterator, range};
2020
use option::{None, Option, Some};
2121
use ptr::RawPtr;
22-
use slice::{OwnedVector, Vector};
22+
use slice::{OwnedVector, Vector, CloneableVector};
2323
use str::{OwnedStr, Str, StrSlice, StrAllocating};
2424
use str;
2525
use vec::Vec;
@@ -273,11 +273,8 @@ impl Str for StrBuf {
273273
impl StrAllocating for StrBuf {
274274
#[inline]
275275
fn into_owned(self) -> ~str {
276-
let StrBuf {
277-
vec: vec
278-
} = self;
279276
unsafe {
280-
cast::transmute::<~[u8],~str>(vec.move_iter().collect())
277+
cast::transmute(self.vec.as_slice().to_owned())
281278
}
282279
}
283280

0 commit comments

Comments
 (0)