about summary refs log tree commit diff
path: root/src/libcore/fmt
diff options
context:
space:
mode:
authorChris Wong <lambda.fairy@gmail.com>2015-02-14 12:56:32 +1300
committerChris Wong <lambda.fairy@gmail.com>2015-02-14 12:56:32 +1300
commitbc9084b9b7f21140ffbc051ecb2a0cd08e88f3bb (patch)
tree7eca299eb3e3c7f1494f067bc6dcb4c119c279dd /src/libcore/fmt
parentcf636c233dfeef5abf0de8fb35e23c0a161810d2 (diff)
downloadrust-bc9084b9b7f21140ffbc051ecb2a0cd08e88f3bb.tar.gz
rust-bc9084b9b7f21140ffbc051ecb2a0cd08e88f3bb.zip
Rename `fmt::Writer` to `fmt::Write`
This brings it in line with its namesake in `std::io`.

[breaking-change]
Diffstat (limited to 'src/libcore/fmt')
-rw-r--r--src/libcore/fmt/float.rs2
-rw-r--r--src/libcore/fmt/mod.rs18
2 files changed, 10 insertions, 10 deletions
diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs
index 25bb959b9b3..56b2c2a7983 100644
--- a/src/libcore/fmt/float.rs
+++ b/src/libcore/fmt/float.rs
@@ -314,7 +314,7 @@ pub fn float_to_str_bytes_common<T: Float, U, F>(
                 end: &'a mut uint,
             }
 
-            impl<'a> fmt::Writer for Filler<'a> {
+            impl<'a> fmt::Write for Filler<'a> {
                 fn write_str(&mut self, s: &str) -> fmt::Result {
                     slice::bytes::copy_memory(&mut self.buf[(*self.end)..],
                                               s.as_bytes());
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index f940300a269..09733df3539 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -57,14 +57,14 @@ pub struct Error;
 /// A collection of methods that are required to format a message into a stream.
 ///
 /// This trait is the type which this modules requires when formatting
-/// information. This is similar to the standard library's `io::Writer` trait,
+/// information. This is similar to the standard library's `io::Write` trait,
 /// but it is only intended for use in libcore.
 ///
 /// This trait should generally not be implemented by consumers of the standard
-/// library. The `write!` macro accepts an instance of `io::Writer`, and the
-/// `io::Writer` trait is favored over implementing this trait.
+/// library. The `write!` macro accepts an instance of `io::Write`, and the
+/// `io::Write` trait is favored over implementing this trait.
 #[stable(feature = "rust1", since = "1.0.0")]
-pub trait Writer {
+pub trait Write {
     /// Writes a slice of bytes into this writer, returning whether the write
     /// succeeded.
     ///
@@ -85,12 +85,12 @@ pub trait Writer {
     #[stable(feature = "rust1", since = "1.0.0")]
     fn write_fmt(&mut self, args: Arguments) -> Result {
         // This Adapter is needed to allow `self` (of type `&mut
-        // Self`) to be cast to a FormatWriter (below) without
+        // Self`) to be cast to a Write (below) without
         // requiring a `Sized` bound.
         struct Adapter<'a,T: ?Sized +'a>(&'a mut T);
 
-        impl<'a, T: ?Sized> Writer for Adapter<'a, T>
-            where T: Writer
+        impl<'a, T: ?Sized> Write for Adapter<'a, T>
+            where T: Write
         {
             fn write_str(&mut self, s: &str) -> Result {
                 self.0.write_str(s)
@@ -116,7 +116,7 @@ pub struct Formatter<'a> {
     width: Option<uint>,
     precision: Option<uint>,
 
-    buf: &'a mut (Writer+'a),
+    buf: &'a mut (Write+'a),
     curarg: slice::Iter<'a, ArgumentV1<'a>>,
     args: &'a [ArgumentV1<'a>],
 }
@@ -367,7 +367,7 @@ pub trait UpperExp {
 ///   * output - the buffer to write output to
 ///   * args - the precompiled arguments generated by `format_args!`
 #[stable(feature = "rust1", since = "1.0.0")]
-pub fn write(output: &mut Writer, args: Arguments) -> Result {
+pub fn write(output: &mut Write, args: Arguments) -> Result {
     let mut formatter = Formatter {
         flags: 0,
         width: None,