提交 523acd98 编写于 作者: B bors

Auto merge of #28368 - lfairy:write-impl, r=alexcrichton

There is already a corresponding impl for `std::io::Write`. This change
will make the two traits more consistent.
......@@ -121,6 +121,21 @@ fn write_fmt(&mut self, args: Arguments) -> Result {
}
}
#[stable(feature = "fmt_write_blanket_impl", since = "1.4.0")]
impl<'a, W: Write + ?Sized> Write for &'a mut W {
fn write_str(&mut self, s: &str) -> Result {
(**self).write_str(s)
}
fn write_char(&mut self, c: char) -> Result {
(**self).write_char(c)
}
fn write_fmt(&mut self, args: Arguments) -> Result {
(**self).write_fmt(args)
}
}
/// A struct to represent both where to emit formatting strings to and how they
/// should be formatted. A mutable version of this is passed to all formatting
/// traits.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册