1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Fix some simply clippy warnings

With:
`cargo +nightly clippy --features unix --allow-dirty --fix -- -W clippy::pedantic`
This commit is contained in:
Sylvestre Ledru 2023-03-18 14:35:53 +01:00
parent 89b83c2f6a
commit d42b4883e1

View file

@ -2812,7 +2812,7 @@ mod tests {
#[should_panic] #[should_panic]
fn test_cmd_result_stdout_check_when_false_then_panics() { fn test_cmd_result_stdout_check_when_false_then_panics() {
let result = TestScenario::new("echo").ucmd().arg("Hello world").run(); let result = TestScenario::new("echo").ucmd().arg("Hello world").run();
result.stdout_check(|s| s.is_empty()); result.stdout_check(<[u8]>::is_empty);
} }
#[cfg(feature = "echo")] #[cfg(feature = "echo")]
@ -3055,9 +3055,10 @@ mod tests {
// check `child.is_alive()` and `child.delay()` is working // check `child.is_alive()` and `child.delay()` is working
let mut trials = 10; let mut trials = 10;
while child.is_alive() { while child.is_alive() {
if trials <= 0 { assert!(
panic!("Assertion failed: child process is still alive.") trials > 0,
} "Assertion failed: child process is still alive."
);
child.delay(500); child.delay(500);
trials -= 1; trials -= 1;