diff options
| author | est31 <MTest31@outlook.com> | 2023-03-04 04:24:09 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2023-03-11 20:40:18 +0100 |
| commit | cde0b164d28382da7de892172d9129f21f8bb179 (patch) | |
| tree | 0bdc80e684d7aca8e255ce581f0bb548ab49812b | |
| parent | 67e1681c1db9545ec05c458cad440a9197617a30 (diff) | |
tidy: allow direct format args capture in macro
| -rw-r--r-- | src/tools/tidy/src/style.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 9ecb30529cc..8b10c635ef4 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -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 { |
