From a694ef1f7345110877ca728c90ab5215e31d00e9 Mon Sep 17 00:00:00 2001 From: Sven Rademakers Date: Wed, 15 May 2024 09:57:33 +0100 Subject: [PATCH] fix cargo clippies --- .cargo/{config => config.toml} | 0 src/turing_pi.rs | 2 +- src/ubi/format.rs | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename .cargo/{config => config.toml} (100%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/src/turing_pi.rs b/src/turing_pi.rs index b4c64c0..fab4a7c 100644 --- a/src/turing_pi.rs +++ b/src/turing_pi.rs @@ -54,7 +54,7 @@ pub fn setup_initramfs() -> anyhow::Result<()> { match result { // Ignore EBUSY, which indicates that the mountpoint is already mounted. - Err(errno) if errno == Errno::EBUSY => (), + Err(Errno::EBUSY) => (), r => r?, }; } diff --git a/src/ubi/format.rs b/src/ubi/format.rs index 40ee280..23c7ac7 100644 --- a/src/ubi/format.rs +++ b/src/ubi/format.rs @@ -287,7 +287,7 @@ where // Begin ubinizing volumes let mut ubinizer = Ubinizer::new(volumes, eb_size); let vid_size = layout.bytes_per_page; - let mut data = Vec::with_capacity(u32::try_from(eb_size).unwrap() as usize + vid_size); + let mut data = Vec::with_capacity(u32::from(eb_size) as usize + vid_size); data.resize(vid_size, 0u8); // Iterate over all logical blocks provided by the Ubinizer