Various small fixes

This commit is contained in:
Lukas Wirth 2023-09-22 08:08:00 +02:00
parent e63e323823
commit 556f0c6704
6 changed files with 22 additions and 20 deletions

View file

@ -15,7 +15,12 @@ macro_rules! eprintln {
macro_rules! format_to {
($buf:expr) => ();
($buf:expr, $lit:literal $($arg:tt)*) => {
{ use ::std::fmt::Write as _; let _ = ::std::write!($buf, $lit $($arg)*); }
{
use ::std::fmt::Write as _;
// We can't do ::std::fmt::Write::write_fmt($buf, format_args!($lit $($arg)*))
// unfortunately, as that loses out on autoref behavior.
_ = $buf.write_fmt(format_args!($lit $($arg)*))
}
};
}