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 f5549de9cf
commit 853a3e0fa0

View File

@ -88,8 +88,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(),
}
}