Skip to content

Commit d1a7280

Browse files
fix: resolve clippy uninlined_format_args warnings
Update format strings to use inline variable syntax to satisfy clippy lints
1 parent 4b9a832 commit d1a7280

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/boxplot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ const PLOT_WIDTH: usize = 80;
55

66
fn generate_axis_labels(minima: f64, maxima: f64) -> String {
77
let mut labels = String::new();
8-
write!(labels, "{:<10.2}", minima).unwrap();
8+
write!(labels, "{minima:<10.2}").unwrap();
99
write!(
1010
labels,
1111
"{:^width$.2}",
1212
(minima + maxima) / 2.0,
1313
width = PLOT_WIDTH - 20
1414
)
1515
.unwrap();
16-
write!(labels, "{:>10.2}", maxima).unwrap();
16+
write!(labels, "{maxima:>10.2}").unwrap();
1717
labels
1818
}
1919

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub enum OutputFormat {
2020

2121
impl Display for OutputFormat {
2222
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
23-
write!(f, "{:?}", self)
23+
write!(f, "{self:?}")
2424
}
2525
}
2626

src/measurements.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn log_measurements_by_test_type(
105105
let (min, q1, median, q3, max, avg) = calc_stats(type_measurements).unwrap();
106106

107107
let formatted_payload = format_bytes(payload_size);
108-
let fmt_test_type = format!("{:?}", test_type);
108+
let fmt_test_type = format!("{test_type:?}");
109109
stat_measurements.push(StatMeasurement {
110110
test_type,
111111
payload_size,
@@ -227,7 +227,7 @@ mod tests {
227227
mbit: 50.5,
228228
};
229229

230-
let display_str = format!("{}", measurement);
230+
let display_str = format!("{measurement}");
231231
assert!(display_str.contains("Download"));
232232
assert!(display_str.contains("1MB"));
233233
assert!(display_str.contains("50.5"));

src/speedtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub fn speed_test(client: Client, options: SpeedTestCLIOptions) -> Vec<Measureme
8686
let metadata = match fetch_metadata(&client) {
8787
Ok(metadata) => metadata,
8888
Err(e) => {
89-
eprintln!("Error fetching metadata: {}", e);
89+
eprintln!("Error fetching metadata: {e}");
9090
std::process::exit(1);
9191
}
9292
};
@@ -454,7 +454,7 @@ mod tests {
454454
#[test]
455455
fn test_payload_size_display() {
456456
let size = PayloadSize::K100;
457-
let display_str = format!("{}", size);
457+
let display_str = format!("{size}");
458458
assert!(!display_str.is_empty());
459459
}
460460

0 commit comments

Comments
 (0)