diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-02 09:16:26 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-02 09:16:26 -0800 |
| commit | 074996d6f982881a5854d299b4aa6e29231ae77d (patch) | |
| tree | 4e05eb22c710477c1b8bbf6fc166f795c8240206 /src/libstd/io | |
| parent | 8b7d032014ccbc9256abdc56e633e7c0a3b8342c (diff) | |
| parent | e423fcf0e0166da55f88233e0be5eacba55bc0bc (diff) | |
| download | rust-074996d6f982881a5854d299b4aa6e29231ae77d.tar.gz rust-074996d6f982881a5854d299b4aa6e29231ae77d.zip | |
rollup merge of #20377: alexcrichton/issue-20352
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 93a9e04501e..813edc3eb53 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1028,16 +1028,16 @@ 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 FormatWriter and saves + // Create a shim which translates a Writer to a fmt::Writer and saves // off I/O errors. instead of discarding them struct Adaptor<'a, T:'a> { inner: &'a mut T, error: IoResult<()>, } - impl<'a, T: Writer> fmt::FormatWriter for Adaptor<'a, T> { - fn write(&mut self, bytes: &[u8]) -> fmt::Result { - match self.inner.write(bytes) { + impl<'a, T: Writer> fmt::Writer for Adaptor<'a, T> { + fn write_str(&mut self, s: &str) -> fmt::Result { + match self.inner.write(s.as_bytes()) { Ok(()) => Ok(()), Err(e) => { self.error = Err(e); |
