Skip to content

Commit

Permalink
clippy:uninlined_format_args
Browse files Browse the repository at this point in the history
warning: variables can be used directly in the `format!` string
  --> src/cmd/rename.rs:96:35
   |
96 |         generic_headers.push_str(&format!("_col_{},", i));
   |                                   ^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `-W clippy::uninlined-format-args` implied by `-W clippy::pedantic`
   = help: to override `-W clippy::pedantic` add `#[allow(clippy::uninlined_format_args)]`
help: change this to
   |
96 -         generic_headers.push_str(&format!("_col_{},", i));
96 +         generic_headers.push_str(&format!("_col_{i},"));
  • Loading branch information
jqnatividad committed Nov 1, 2023
1 parent 85c1e42 commit 9dabcd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
pub(crate) fn rename_headers_all_generic(num_of_cols: usize) -> String {
let mut generic_headers = String::new();
for i in 1..=num_of_cols {
generic_headers.push_str(&format!("_col_{},", i));
generic_headers.push_str(&format!("_col_{i},"));
}
// remove the trailing comma
generic_headers.pop();
Expand Down

0 comments on commit 9dabcd8

Please sign in to comment.