mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
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:
commit
850ba2fb63
39 changed files with 136 additions and 149 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue