We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44e8021 commit bbc35eaCopy full SHA for bbc35ea
src/libstd/strbuf.rs
@@ -19,7 +19,7 @@ use io::Writer;
19
use iter::{Extendable, FromIterator, Iterator, range};
20
use option::{None, Option, Some};
21
use ptr::RawPtr;
22
-use slice::{OwnedVector, Vector};
+use slice::{OwnedVector, Vector, CloneableVector};
23
use str::{OwnedStr, Str, StrSlice, StrAllocating};
24
use str;
25
use vec::Vec;
@@ -273,11 +273,8 @@ impl Str for StrBuf {
273
impl StrAllocating for StrBuf {
274
#[inline]
275
fn into_owned(self) -> ~str {
276
- let StrBuf {
277
- vec: vec
278
- } = self;
279
unsafe {
280
- cast::transmute::<~[u8],~str>(vec.move_iter().collect())
+ cast::transmute(self.vec.as_slice().to_owned())
281
}
282
283
0 commit comments