Skip to content

Commit

Permalink
Don't reborrow the target of a write!()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lambda-fairy committed Apr 1, 2015
1 parent d754722 commit 7c3efcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/macros.rs
Expand Up @@ -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
Expand Down

0 comments on commit 7c3efcc

Please sign in to comment.