mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
tidy: allow direct format args capture in macro
This commit is contained in:
parent
67e1681c1d
commit
cde0b164d2
@ -171,9 +171,9 @@ fn contains_ignore_directive(can_contain: bool, contents: &str, check: &str) ->
|
||||
}
|
||||
|
||||
macro_rules! suppressible_tidy_err {
|
||||
($err:ident, $skip:ident, $msg:expr) => {
|
||||
($err:ident, $skip:ident, $msg:literal) => {
|
||||
if let Directive::Deny = $skip {
|
||||
$err($msg);
|
||||
$err(&format!($msg));
|
||||
} else {
|
||||
$skip = Directive::Ignore(true);
|
||||
}
|
||||
@ -351,7 +351,7 @@ pub fn check(path: &Path, bad: &mut bool) {
|
||||
suppressible_tidy_err!(
|
||||
err,
|
||||
skip_line_length,
|
||||
&format!("line longer than {max_columns} chars")
|
||||
"line longer than {max_columns} chars"
|
||||
);
|
||||
}
|
||||
if !is_style_file && line.contains('\t') {
|
||||
@ -441,7 +441,7 @@ pub fn check(path: &Path, bad: &mut bool) {
|
||||
n => suppressible_tidy_err!(
|
||||
err,
|
||||
skip_trailing_newlines,
|
||||
&format!("too many trailing newlines ({n})")
|
||||
"too many trailing newlines ({n})"
|
||||
),
|
||||
};
|
||||
if lines > LINES {
|
||||
|
Loading…
Reference in New Issue
Block a user