Skip to content

Commit

Permalink
Fix must_use lint for command exec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
c-ryan747 authored Oct 17, 2024
1 parent 09f75b9 commit 9b5b607
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ui/command/command-exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@ fn main() {
}

"exec-test2" => {
Command::new("/path/to/nowhere").exec();
let _ = Command::new("/path/to/nowhere").exec();
println!("passed");
}

"exec-test3" => {
Command::new(&me).arg("bad\0").exec();
let _ = Command::new(&me).arg("bad\0").exec();
println!("passed");
}

"exec-test4" => {
Command::new(&me).current_dir("/path/to/nowhere").exec();
let _ = Command::new(&me).current_dir("/path/to/nowhere").exec();
println!("passed");
}

"exec-test5" => {
env::set_var("VARIABLE", "ABC");
Command::new("definitely-not-a-real-binary").env("VARIABLE", "XYZ").exec();
let _ = Command::new("definitely-not-a-real-binary").env("VARIABLE", "XYZ").exec();
assert_eq!(env::var("VARIABLE").unwrap(), "ABC");
println!("passed");
}
Expand Down

0 comments on commit 9b5b607

Please sign in to comment.