diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-17 15:52:01 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-17 17:33:20 +0530 |
| commit | bf52f2eef578e6fff83611a6276a3aa9f284e1c5 (patch) | |
| tree | b8dbe9baff53cc9def4e2a78fdd9d8b96a585a30 /src/libstd | |
| parent | 4647d89205992383f8122e8fde0e2615497572bc (diff) | |
| parent | bc9084b9b7f21140ffbc051ecb2a0cd08e88f3bb (diff) | |
| download | rust-bf52f2eef578e6fff83611a6276a3aa9f284e1c5.tar.gz rust-bf52f2eef578e6fff83611a6276a3aa9f284e1c5.zip | |
Rollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichton
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/io/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/old_io/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/rt/unwind.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/util.rs | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 1243df2f93e..c38d52161c9 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 3673f590c0a..3b35444df31 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 b45878584e0..c9bbea27e4a 100644 --- a/src/libstd/rt/unwind.rs +++ b/src/libstd/rt/unwind.rs @@ -495,7 +495,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())]; |
