Mark all format-like macros for Clippy

See https://doc.rust-lang.org/nightly/clippy/attribs.html#clippyformat_args
This commit is contained in:
Yuri Astrakhan 2025-02-20 21:48:17 -05:00
parent fd0f6e822a
commit 6987de828c
3 changed files with 4 additions and 1 deletions

View file

@ -131,6 +131,7 @@ pub fn print_to_console(env: Env, function: &str, arguments: core::fmt::Argument
}
#[macro_export]
#[clippy::format_args]
macro_rules! console_err {
($env:expr, $($t:tt)*) => ($crate::print_to_console($env, "error", format_args!($($t)*)))
}

View file

@ -19,6 +19,7 @@ use core::ops::Deref;
/// assert_eq!(s, slint::SharedString::from("Hello world"));
/// ```
#[macro_export]
#[clippy::format_args]
macro_rules! format {
($($arg:tt)*) => {{
$crate::string::format(core::format_args!($($arg)*))

View file

@ -117,9 +117,10 @@ pub fn default_debug_log(_arguments: core::fmt::Arguments) {
}
}
#[macro_export]
/// This macro allows producing debug output that will appear on stderr in regular builds
/// and in the console log for wasm builds.
#[macro_export]
#[clippy::format_args]
macro_rules! debug_log {
($($t:tt)*) => ($crate::tests::debug_log_impl(format_args!($($t)*)))
}