1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

tests/common/util: Use is_none_or instead of map_or

Following clippy advice:
error: this `map_or` can be simplified
     --> tests\common\util.rs:411:9
      |
  411 |         self.exit_status.map_or(true, |e| e.success())
      |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use is_none_or instead: `self.exit_status.is_none_or(|e| e.success())`
This commit is contained in:
Nicolas Boichat 2025-03-04 09:57:13 +01:00
parent a43fd11266
commit c6e06af84a

View file

@ -408,7 +408,7 @@ impl CmdResult {
/// Returns whether the program succeeded
pub fn succeeded(&self) -> bool {
self.exit_status.map_or(true, |e| e.success())
self.exit_status.is_none_or(|e| e.success())
}
/// asserts that the command resulted in a success (zero) status code