Rollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichton

This brings it in line with its namesake in `std::io`.

[breaking-change]

r? @aturon
This commit is contained in:
Manish Goregaokar
2015-02-17 15:52:01 +05:30
11 changed files with 35 additions and 35 deletions

View File

@@ -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(()),