mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-31 15:25:26 +00:00
random: Fix "nonminimal-bool" clippy warning
The error shown below was caught during a dependency bump in the CCv0 branch, but we better fix it here first. ``` error: this boolean expression can be simplified --> src/random.rs:85:21 | 85 | assert!(!ret.is_ok()); | ^^^^^^^^^^^^ help: try: `ret.is_err()` | = note: `-D clippy::nonminimal-bool` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool error: this boolean expression can be simplified --> src/random.rs:93:17 | 93 | assert!(!ret.is_ok()); | ^^^^^^^^^^^^ help: try: `ret.is_err()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool ``` Fixes: #4523 Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
d4417f210e
commit
612fd79bae
@ -82,7 +82,7 @@ mod tests {
|
||||
if nix::unistd::Uid::effective().is_root() {
|
||||
assert!(ret.is_ok());
|
||||
} else {
|
||||
assert!(!ret.is_ok());
|
||||
assert!(ret.is_err());
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,6 +90,6 @@ mod tests {
|
||||
fn test_reseed_rng_zero_data() {
|
||||
let seed = [];
|
||||
let ret = reseed_rng(&seed);
|
||||
assert!(!ret.is_ok());
|
||||
assert!(ret.is_err());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user