diff options
| author | bors <bors@rust-lang.org> | 2015-02-17 15:55:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-17 15:55:55 +0000 |
| commit | f9aeea7cb7865a2b82e7102837daabbe549177ea (patch) | |
| tree | 3f624ffaf751ef16c4630d068944dcf859d6a1d8 /src/libstd | |
| parent | f1bb6c2f46f08c1d7b6d695f5b3cf93142cb8860 (diff) | |
| parent | bc9084b9b7f21140ffbc051ecb2a0cd08e88f3bb (diff) | |
| download | rust-f9aeea7cb7865a2b82e7102837daabbe549177ea.tar.gz rust-f9aeea7cb7865a2b82e7102837daabbe549177ea.zip | |
Auto 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 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 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())]; |
