From bc9084b9b7f21140ffbc051ecb2a0cd08e88f3bb Mon Sep 17 00:00:00 2001 From: Chris Wong Date: Sat, 14 Feb 2015 12:56:32 +1300 Subject: Rename `fmt::Writer` to `fmt::Write` This brings it in line with its namesake in `std::io`. [breaking-change] --- src/libstd/io/mod.rs | 4 ++-- src/libstd/old_io/mod.rs | 4 ++-- src/libstd/rt/unwind.rs | 2 +- src/libstd/rt/util.rs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 2668baba095..89c45f60d1c 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -381,14 +381,14 @@ pub trait Write { /// /// This function will return any I/O error reported while formatting. fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<()> { - // Create a shim which translates a Writer to a fmt::Writer and saves + // Create a shim which translates a Write to a fmt::Write and saves // off I/O errors. instead of discarding them struct Adaptor<'a, T: ?Sized + 'a> { inner: &'a mut T, error: Result<()>, } - impl<'a, T: Write + ?Sized> fmt::Writer for Adaptor<'a, T> { + impl<'a, T: Write + ?Sized> fmt::Write for Adaptor<'a, T> { fn write_str(&mut self, s: &str) -> fmt::Result { match self.inner.write_all(s.as_bytes()) { Ok(()) => Ok(()), diff --git a/src/libstd/old_io/mod.rs b/src/libstd/old_io/mod.rs index 94f4af8e558..cf930ae736c 100644 --- a/src/libstd/old_io/mod.rs +++ b/src/libstd/old_io/mod.rs @@ -1023,14 +1023,14 @@ pub trait Writer { /// /// This function will return any I/O error reported while formatting. fn write_fmt(&mut self, fmt: fmt::Arguments) -> IoResult<()> { - // Create a shim which translates a Writer to a fmt::Writer and saves + // Create a shim which translates a Writer to a fmt::Write and saves // off I/O errors. instead of discarding them struct Adaptor<'a, T: ?Sized +'a> { inner: &'a mut T, error: IoResult<()>, } - impl<'a, T: ?Sized + Writer> fmt::Writer for Adaptor<'a, T> { + impl<'a, T: ?Sized + Writer> fmt::Write for Adaptor<'a, T> { fn write_str(&mut self, s: &str) -> fmt::Result { match self.inner.write_all(s.as_bytes()) { Ok(()) => Ok(()), diff --git a/src/libstd/rt/unwind.rs b/src/libstd/rt/unwind.rs index 659e787a9ff..6abe920e1ea 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -496,7 +496,7 @@ pub extern fn rust_begin_unwind(msg: fmt::Arguments, #[inline(never)] #[cold] #[stable(since = "1.0.0", feature = "rust1")] pub fn begin_unwind_fmt(msg: fmt::Arguments, file_line: &(&'static str, uint)) -> ! { - use fmt::Writer; + use fmt::Write; // We do two allocations here, unfortunately. But (a) they're // required with the current scheme, and (b) we don't handle diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs index bb57d19ed26..d445c299028 100644 --- a/src/libstd/rt/util.rs +++ b/src/libstd/rt/util.rs @@ -110,7 +110,7 @@ impl Stdio { } } -impl fmt::Writer for Stdio { +impl fmt::Write for Stdio { fn write_str(&mut self, data: &str) -> fmt::Result { self.write_bytes(data.as_bytes()); Ok(()) // yes, we're lying @@ -122,13 +122,13 @@ pub fn dumb_print(args: fmt::Arguments) { } pub fn abort(args: fmt::Arguments) -> ! { - use fmt::Writer; + use fmt::Write; struct BufWriter<'a> { buf: &'a mut [u8], pos: uint, } - impl<'a> fmt::Writer for BufWriter<'a> { + impl<'a> fmt::Write for BufWriter<'a> { fn write_str(&mut self, bytes: &str) -> fmt::Result { let left = &mut self.buf[self.pos..]; let to_write = &bytes.as_bytes()[..cmp::min(bytes.len(), left.len())]; -- cgit 1.4.1-3-g733a5