diff --git a/tests/by-util/test_od.rs b/tests/by-util/test_od.rs index 6c167b325..a6a81d1d6 100644 --- a/tests/by-util/test_od.rs +++ b/tests/by-util/test_od.rs @@ -37,7 +37,7 @@ fn test_file() { let mut f = File::create(&file).unwrap(); // spell-checker:disable-next-line assert!( - !f.write_all(b"abcdefghijklmnopqrstuvwxyz\n").is_err(), + f.write_all(b"abcdefghijklmnopqrstuvwxyz\n").is_ok(), "Test setup failed - could not write file" ); } @@ -78,7 +78,7 @@ fn test_2files() { for &(path, data) in &[(&file1, "abcdefghijklmnop"), (&file2, "qrstuvwxyz\n")] { let mut f = File::create(&path).unwrap(); assert!( - !f.write_all(data.as_bytes()).is_err(), + f.write_all(data.as_bytes()).is_ok(), "Test setup failed - could not write file" ); } @@ -130,7 +130,7 @@ fn test_from_mixed() { for &(path, data) in &[(&file1, data1), (&file3, data3)] { let mut f = File::create(&path).unwrap(); assert!( - !f.write_all(data.as_bytes()).is_err(), + f.write_all(data.as_bytes()).is_ok(), "Test setup failed - could not write file" ); } diff --git a/tests/common/util.rs b/tests/common/util.rs index 79fe4d5d7..0b44851db 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -982,7 +982,7 @@ impl UCommand { /// provides standard input to feed in to the command when spawned pub fn pipe_in>>(&mut self, input: T) -> &mut UCommand { assert!( - !self.bytes_into_stdin.is_some(), + self.bytes_into_stdin.is_none(), "{}", MULTIPLE_STDIN_MEANINGLESS ); @@ -1000,7 +1000,7 @@ impl UCommand { /// This is typically useful to test non-standard workflows /// like feeding something to a command that does not read it pub fn ignore_stdin_write_error(&mut self) -> &mut UCommand { - assert!(!self.bytes_into_stdin.is_none(), "{}", NO_STDIN_MEANINGLESS); + assert!(self.bytes_into_stdin.is_some(), "{}", NO_STDIN_MEANINGLESS); self.ignore_stdin_write_error = true; self }