diff options
| author | bors <bors@rust-lang.org> | 2015-04-22 03:38:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-04-22 03:38:20 +0000 |
| commit | c0eb9384af9f623563df59a9ae454ffedea1f4f8 (patch) | |
| tree | aaa36f5462dfe299902c6829795a8a8988f3061e /src/libcollections/string.rs | |
| parent | 2baf3482537f5a245a9c17ca730398f1a8b001d7 (diff) | |
| parent | 58150640254e939519e57bf643af841cc60c1ac3 (diff) | |
| download | rust-c0eb9384af9f623563df59a9ae454ffedea1f4f8.tar.gz rust-c0eb9384af9f623563df59a9ae454ffedea1f4f8.zip | |
Auto merge of #24674 - alexcrichton:rollup, r=alexcrichton
Diffstat (limited to 'src/libcollections/string.rs')
| -rw-r--r-- | src/libcollections/string.rs | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 85f8a9caaaa..a37a26ef22a 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -14,10 +14,9 @@ use core::prelude::*; -use core::default::Default; use core::fmt; use core::hash; -use core::iter::{IntoIterator, FromIterator}; +use core::iter::FromIterator; use core::mem; use core::ops::{self, Deref, Add, Index}; use core::ptr; @@ -837,15 +836,6 @@ impl<'a, 'b> PartialEq<Cow<'a, str>> for &'b str { fn ne(&self, other: &Cow<'a, str>) -> bool { PartialEq::ne(&self[..], &other[..]) } } -#[unstable(feature = "collections", reason = "waiting on Str stabilization")] -#[allow(deprecated)] -impl Str for String { - #[inline] - fn as_slice(&self) -> &str { - unsafe { mem::transmute(&*self.vec) } - } -} - #[stable(feature = "rust1", since = "1.0.0")] impl Default for String { #[inline] @@ -1067,14 +1057,6 @@ impl<'a> IntoCow<'a, str> for &'a str { } } -#[allow(deprecated)] -impl<'a> Str for Cow<'a, str> { - #[inline] - fn as_slice<'b>(&'b self) -> &'b str { - &**self - } -} - #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Write for String { #[inline] @@ -1082,4 +1064,10 @@ impl fmt::Write for String { self.push_str(s); Ok(()) } + + #[inline] + fn write_char(&mut self, c: char) -> fmt::Result { + self.push(c); + Ok(()) + } } |
