From 2c24fcf34c69bd54b8d069f75ae1e250ace70852 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 5dc1d9358f..739fa04595 100644 --- a/src/runtime-rs/crates/resource/src/share_fs/mod.rs +++ b/src/runtime-rs/crates/resource/src/share_fs/mod.rs @@ -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(), } }