Skip to content

Commit cde0b16

Browse files
committed
tidy: allow direct format args capture in macro
1 parent 67e1681 commit cde0b16

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tools/tidy/src/style.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ fn contains_ignore_directive(can_contain: bool, contents: &str, check: &str) ->
171171
}
172172

173173
macro_rules! suppressible_tidy_err {
174-
($err:ident, $skip:ident, $msg:expr) => {
174+
($err:ident, $skip:ident, $msg:literal) => {
175175
if let Directive::Deny = $skip {
176-
$err($msg);
176+
$err(&format!($msg));
177177
} else {
178178
$skip = Directive::Ignore(true);
179179
}
@@ -351,7 +351,7 @@ pub fn check(path: &Path, bad: &mut bool) {
351351
suppressible_tidy_err!(
352352
err,
353353
skip_line_length,
354-
&format!("line longer than {max_columns} chars")
354+
"line longer than {max_columns} chars"
355355
);
356356
}
357357
if !is_style_file && line.contains('\t') {
@@ -441,7 +441,7 @@ pub fn check(path: &Path, bad: &mut bool) {
441441
n => suppressible_tidy_err!(
442442
err,
443443
skip_trailing_newlines,
444-
&format!("too many trailing newlines ({n})")
444+
"too many trailing newlines ({n})"
445445
),
446446
};
447447
if lines > LINES {

0 commit comments

Comments
 (0)