runtime-rs: Fix clippy::bool-to-int-with-if warnings

As we bumped the rust toolchain to 1.66.0, some new warnings have been
raised due to boolean to int conversion using if.

Let's fix them all here.

For more info about the warnings, please, take a look at:
https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-01-02 16:25:43 +01:00
parent 025e78341e
commit 2c24fcf34c

View File

@ -89,8 +89,8 @@ impl MountedInfo {
pub fn new(guest_path: PathBuf, readonly: bool) -> Self {
Self {
guest_path,
ro_ref_count: if readonly { 1 } else { 0 },
rw_ref_count: if readonly { 0 } else { 1 },
ro_ref_count: readonly.into(),
rw_ref_count: (!readonly).into(),
}
}