Skip to content

Commit fb142c1

Browse files
committed
Fix clippy::uninlined_format_args warning
``` error: variables can be used directly in the `format!` string --> examples/timeout.rs:75:9 | 75 | println!("Stdout:\n{}", stdout); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-D clippy::uninlined-format-args` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::uninlined_format_args)]` help: change this to | 75 - println!("Stdout:\n{}", stdout); 75 + println!("Stdout:\n{stdout}"); | error: variables can be used directly in the `format!` string --> examples/timeout.rs:76:9 | 76 | println!("Stderr:\n{}", stderr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 76 - println!("Stderr:\n{}", stderr); 76 + println!("Stderr:\n{stderr}"); | error: could not compile `async-process` (example "timeout") due to 2 previous errors warning: build failed, waiting for other jobs to finish... error: variables can be used directly in the `format!` string --> tests/std.rs:80:23 | 80 | result => panic!("not terminated by signal 9 (instead, {:?})", result), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `-D clippy::uninlined-format-args` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::uninlined_format_args)]` help: change this to | 80 - result => panic!("not terminated by signal 9 (instead, {:?})", result), 80 + result => panic!("not terminated by signal 9 (instead, {result:?})"), | error: variables can be used directly in the `format!` string --> tests/std.rs:335:9 | 335 | / assert!( 336 | | output.contains("RUN_TEST_NEW_ENV=123"), 337 | | "didn't find RUN_TEST_NEW_ENV inside of:\n\n{}", 338 | | output 339 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args error: variables can be used directly in the `format!` string --> tests/std.rs:353:9 | 353 | / assert!( 354 | | output.contains("RUN_TEST_NEW_ENV=123"), 355 | | "didn't find RUN_TEST_NEW_ENV inside of:\n\n{}", 356 | | output 357 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args error: variables can be used directly in the `format!` string --> tests/std.rs:375:9 | 375 | / assert!( 376 | | output.contains("RUN_TEST_NEW_ENV1=123"), 377 | | "didn't find RUN_TEST_NEW_ENV1 inside of:\n\n{}", 378 | | output 379 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args error: variables can be used directly in the `format!` string --> tests/std.rs:380:9 | 380 | / assert!( 381 | | output.contains("RUN_TEST_NEW_ENV2=456"), 382 | | "didn't find RUN_TEST_NEW_ENV2 inside of:\n\n{}", 383 | | output 384 | | ); | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args ```
1 parent 89dc413 commit fb142c1

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

examples/timeout.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ fn main() -> io::Result<()> {
7272
println!("The child exited.");
7373
}
7474

75-
println!("Stdout:\n{}", stdout);
76-
println!("Stderr:\n{}", stderr);
75+
println!("Stdout:\n{stdout}");
76+
println!("Stderr:\n{stderr}");
7777

7878
Ok(())
7979
})

tests/std.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn signal_reported_right() {
7777
p.kill().unwrap();
7878
match p.status().await.unwrap().signal() {
7979
Some(9) => {}
80-
result => panic!("not terminated by signal 9 (instead, {:?})", result),
80+
result => panic!("not terminated by signal 9 (instead, {result:?})"),
8181
}
8282
})
8383
}
@@ -334,8 +334,7 @@ fn test_override_env() {
334334

335335
assert!(
336336
output.contains("RUN_TEST_NEW_ENV=123"),
337-
"didn't find RUN_TEST_NEW_ENV inside of:\n\n{}",
338-
output
337+
"didn't find RUN_TEST_NEW_ENV inside of:\n\n{output}"
339338
);
340339
})
341340
}
@@ -352,8 +351,7 @@ fn test_add_to_env() {
352351

353352
assert!(
354353
output.contains("RUN_TEST_NEW_ENV=123"),
355-
"didn't find RUN_TEST_NEW_ENV inside of:\n\n{}",
356-
output
354+
"didn't find RUN_TEST_NEW_ENV inside of:\n\n{output}"
357355
);
358356
})
359357
}
@@ -374,13 +372,11 @@ fn test_capture_env_at_spawn() {
374372

375373
assert!(
376374
output.contains("RUN_TEST_NEW_ENV1=123"),
377-
"didn't find RUN_TEST_NEW_ENV1 inside of:\n\n{}",
378-
output
375+
"didn't find RUN_TEST_NEW_ENV1 inside of:\n\n{output}"
379376
);
380377
assert!(
381378
output.contains("RUN_TEST_NEW_ENV2=456"),
382-
"didn't find RUN_TEST_NEW_ENV2 inside of:\n\n{}",
383-
output
379+
"didn't find RUN_TEST_NEW_ENV2 inside of:\n\n{output}"
384380
);
385381
})
386382
}

0 commit comments

Comments
 (0)