From c16c1bde86ce9856b24dc77bf49b6fac509fda04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 2 Jan 2023 13:27:57 +0100 Subject: [PATCH] kata-sys-util: Fix unnecessary_cast 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 unnecessary_cast. 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#unnecessary_cast Signed-off-by: Fabiano FidĂȘncio --- src/libs/kata-sys-util/src/mount.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/kata-sys-util/src/mount.rs b/src/libs/kata-sys-util/src/mount.rs index 82161c96c6..3abc6fe7ae 100644 --- a/src/libs/kata-sys-util/src/mount.rs +++ b/src/libs/kata-sys-util/src/mount.rs @@ -592,7 +592,7 @@ fn compact_lowerdir_option(opts: &[String]) -> (Option, Vec) { } }; - let idx = idx as usize; + let idx = idx; let common_dir = match get_longest_common_prefix(&lower_opts) { None => return (None, n_opts), Some(v) => { @@ -620,7 +620,7 @@ fn compact_lowerdir_option(opts: &[String]) -> (Option, Vec) { .iter() .map(|c| c.replace(&common_prefix, "")) .collect(); - n_opts[idx as usize] = format!("lowerdir={}", lower.join(":")); + n_opts[idx] = format!("lowerdir={}", lower.join(":")); (Some(common_dir), n_opts) }