mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 07:05:47 +02:00
Use variable names directly in the format strings (#7906)
# Description Lint: `clippy::uninlined_format_args` More readable in most situations. (May be slightly confusing for modifier format strings https://doc.rust-lang.org/std/fmt/index.html#formatting-parameters) Alternative to #7865 # User-Facing Changes None intended # Tests + Formatting (Ran `cargo +stable clippy --fix --workspace -- -A clippy::all -D clippy::uninlined_format_args` to achieve this. Depends on Rust `1.67`)
This commit is contained in:
committed by
GitHub
parent
6ae497eedc
commit
ab480856a5
@ -45,7 +45,7 @@ fn compute_sum_of_individual_row() -> Result<(), String> {
|
||||
for (column_name, expected_value) in answers_for_columns {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats/",
|
||||
format!("open sample-ps-output.json | select {} | math sum | get {}", column_name, column_name)
|
||||
format!("open sample-ps-output.json | select {column_name} | math sum | get {column_name}")
|
||||
);
|
||||
let result =
|
||||
f64::from_str(&actual.out).map_err(|_| String::from("Failed to parse float."))?;
|
||||
@ -66,7 +66,7 @@ fn compute_sum_of_table() -> Result<(), String> {
|
||||
for (column_name, expected_value) in answers_for_columns {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats/",
|
||||
format!("open sample-ps-output.json | select cpu mem virtual | math sum | get {}", column_name)
|
||||
format!("open sample-ps-output.json | select cpu mem virtual | math sum | get {column_name}")
|
||||
);
|
||||
let result =
|
||||
f64::from_str(&actual.out).map_err(|_| String::from("Failed to parse float."))?;
|
||||
|
Reference in New Issue
Block a user