Don't reborrow the target of a write!()

This means passing in e.g. a `Vec<u8>` or `String` will work as
intended, rather than deref-ing to `&mut [u8]` or `&mut str`.

[breaking-change]

Closes #23768
This commit is contained in:
Chris Wong 2015-04-01 19:48:49 +13:00
parent d754722a04
commit 7c3efcc5bb

View file

@ -184,7 +184,7 @@ macro_rules! try {
/// ```
#[macro_export]
macro_rules! write {
($dst:expr, $($arg:tt)*) => ((&mut *$dst).write_fmt(format_args!($($arg)*)))
($dst:expr, $($arg:tt)*) => ($dst.write_fmt(format_args!($($arg)*)))
}
/// Equivalent to the `write!` macro, except that a newline is appended after