diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-07 14:58:31 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-07 15:24:21 -0800 |
| commit | 9851b4fbbf327bb1baab3182ce92970d4db22c6c (patch) | |
| tree | cc315eacedccbe68cc91a8cbf676271dc614153c /src/libcore/option.rs | |
| parent | 9f1ead8fadc56bad30dc74f5cc50d78af4fbc972 (diff) | |
| download | rust-9851b4fbbf327bb1baab3182ce92970d4db22c6c.tar.gz rust-9851b4fbbf327bb1baab3182ce92970d4db22c6c.zip | |
std: Tweak String implementations
This commit performs a pass over the implementations of the new `String` trait
in the formatting module. Some implementations were removed as a conservative
move pending an upcoming convention about `String` implementations, and some
were added in order to retain consistency across the libraries. Specifically:
* All "smart pointers" implement `String` now, adding missing implementations
for `Arc` and `Rc`.
* The `Vec<T>` and `[T]` types no longer implement `String`.
* The `*const T` and `*mut T` type no longer implement `String`.
* The `()` type no longer implements `String`.
* The `Path` type's `Show` implementation does not surround itself with `Path
{}` (a minor tweak).
All implementations of `String` in this PR were also marked `#[stable]` to
indicate that the types will continue to implement the `String` trait regardless
of what it looks like.
Diffstat (limited to 'src/libcore/option.rs')
| -rw-r--r-- | src/libcore/option.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 272570a0d5b..56e27e801af 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -145,17 +145,18 @@ use self::Option::*; +use clone::Clone; use cmp::{Eq, Ord}; use default::Default; -use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator}; +use fmt; use iter::{ExactSizeIterator}; +use iter::{Iterator, IteratorExt, DoubleEndedIterator, FromIterator}; use mem; -use result::Result; +use ops::{Deref, FnOnce}; use result::Result::{Ok, Err}; -use slice; +use result::Result; use slice::AsSlice; -use clone::Clone; -use ops::{Deref, FnOnce}; +use slice; // Note that this is not a lang item per se, but it has a hidden dependency on // `Iterator`, which is one. The compiler assumes that the `next` method of @@ -762,7 +763,6 @@ impl<T> AsSlice<T> for Option<T> { #[stable] impl<T> Default for Option<T> { - #[stable] #[inline] #[stable] fn default() -> Option<T> { None } |
