-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
After upgrading to the latest version of Rust and clippy, I'm getting the following warning in println! and format! statements:
error: variables can be used directly in the `format!` string
--> src/runtimes/metadata.rs:39:13
|
39 | println!("Err: {:?}", err);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
|
39 - println!("Err: {:?}", err);
39 + println!("Err: {err:?}");
|
This comes from a new linter rule that was introduced in Rust 1.66: uninlined format args. The warning is an error in the example as we're forcing this via parameters (cargo clippy -- -D warnings). The fix is quite simple and the code is more readable when adding the arguments inline.
Metadata
Metadata
Assignees
Labels
🚀 enhancementNew feature or requestNew feature or request