Skip to content

Commit

Permalink
Quiet a clippy::literal_string_with_formatting_args warning (#632)
Browse files Browse the repository at this point in the history
As this crate is a proc macro, the code was generating a formatting
string to emit in the generated code.  So the warning is a false alarm.
  • Loading branch information
asomers authored Dec 31, 2024
1 parent 9d6e632 commit 2e931ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mockall_derive/src/mock_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ impl MockFunction {
} else {
format!("{}::{}", self.mod_ident, self.sig.ident)
};
#[allow(clippy::literal_string_with_formatting_args)]
let fields = vec!["{:?}"; argnames.len()].join(", ");
let fstr = format!("{name}({fields})");
quote!(std::format!(#fstr, #((&&::mockall::ArgPrinter(&#argnames)).debug_string()),*))
Expand Down

0 comments on commit 2e931ad

Please sign in to comment.