From 853a3e0fa0cc4a40de38b6bc2a65073bfa40614c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 2 Jan 2023 16:25:43 +0100 Subject: [PATCH] runtime-rs: Fix clippy::bool-to-int-with-if warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/runtime-rs/crates/resource/src/share_fs/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime-rs/crates/resource/src/share_fs/mod.rs b/src/runtime-rs/crates/resource/src/share_fs/mod.rs index 96f6dc32f1..dcb90bfb50 100644 --- a/src/runtime-rs/crates/resource/src/share_fs/mod.rs +++ b/src/runtime-rs/crates/resource/src/share_fs/mod.rs @@ -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(), } }