mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-31 08:28:34 +00:00
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:
@@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user