Auto merge of #16451 - Urhengulas:satisfy-clippy, r=Veykril

internal: Work through temporarily allowed clippy lints, part 2

Another follow-up to https://github.com/rust-lang/rust-analyzer/pull/16401.
This commit is contained in:
bors 2024-02-01 14:23:18 +00:00
commit 850ba2fb63
39 changed files with 136 additions and 149 deletions

View file

@ -14,6 +14,22 @@ macro_rules! format_to {
};
}
/// Appends formatted string to a `String` and returns the `String`.
///
/// Useful for folding iterators into a `String`.
#[macro_export]
macro_rules! format_to_acc {
($buf:expr, $lit:literal $($arg:tt)*) => {
{
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)*));
$buf
}
};
}
/// Generates `From` impls for `Enum E { Foo(Foo), Bar(Bar) }` enums
///
/// # Example