about summary refs log tree commit diff
path: root/src/libstd/path
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-01-07 14:58:31 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-01-07 15:24:21 -0800
commit9851b4fbbf327bb1baab3182ce92970d4db22c6c (patch)
treecc315eacedccbe68cc91a8cbf676271dc614153c /src/libstd/path
parent9f1ead8fadc56bad30dc74f5cc50d78af4fbc972 (diff)
downloadrust-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/libstd/path')
-rw-r--r--src/libstd/path/posix.rs2
-rw-r--r--src/libstd/path/windows.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs
index 0b7dc19fcab..f7dcef52a58 100644
--- a/src/libstd/path/posix.rs
+++ b/src/libstd/path/posix.rs
@@ -60,7 +60,7 @@ pub fn is_sep(c: char) -> bool {
 
 impl fmt::Show for Path {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        write!(f, "Path {{ {} }}", self.display())
+        fmt::Show::fmt(&self.display(), f)
     }
 }
 
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index 5c4e7aa9ac2..e32c67548fc 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -87,7 +87,7 @@ pub struct Path {
 
 impl fmt::Show for Path {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        write!(f, "Path {{ {} }}", self.display())
+        fmt::Show::fmt(&self.display(), f)
     }
 }