From 49343e5811ba870c2248bd1fe7e704aaa7b9cb54 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Wed, 17 Jun 2026 17:42:41 +0200 Subject: [PATCH] fix: clippy --- src/qemu_vm.rs | 7 +++++-- src/utils.rs | 18 ------------------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/qemu_vm.rs b/src/qemu_vm.rs index 71b0448..fc59ff3 100644 --- a/src/qemu_vm.rs +++ b/src/qemu_vm.rs @@ -214,7 +214,10 @@ fn check_kvm_capabilities() -> bool { } /// Create an uncompressed cpio initramfs from a directory -fn create_initramfs(rootfs: &PathBuf) -> Result { +/// A filesystem entry for cpio archives: (name, mode, mtime, nlink, data) +type CpioEntry = (String, u32, u32, u32, Vec); + +fn create_initramfs(rootfs: &Path) -> Result { // Create a temporary file for the initramfs (uncompressed cpio) // Use a temp file in the same directory as rootfs, or fall back to /tmp let initramfs_path = rootfs @@ -387,7 +390,7 @@ fn collect_entries( current: &Path, pb: &ProgressBar, seen_inodes: &mut std::collections::HashMap<(u64, u64), String>, -) -> Result)>> { +) -> Result> { let mut entries = Vec::new(); let mut total_data: u64 = 0; diff --git a/src/utils.rs b/src/utils.rs index 8ba2ff1..d849dec 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -54,19 +54,6 @@ impl Arch { } } - /// Get the canonical name (uname -m style) - pub fn canonical_name(&self) -> &'static str { - match self { - Arch::Amd64 => "x86_64", - Arch::Arm64 => "aarch64", - Arch::Armhf => "armv7l", - Arch::Riscv64 => "riscv64", - Arch::Ppc64el => "ppc64le", - Arch::S390x => "s390x", - Arch::Unknown => "unknown", - } - } - /// Get the Debian/Ubuntu style name pub fn debian_name(&self) -> &'static str { match self { @@ -157,11 +144,6 @@ pub fn get_host_arch() -> Arch { Arch::from_str(machine.as_ref()) } -/// Normalize an architecture string to canonical (uname -m) form -pub fn normalize_arch(arch: &str) -> String { - Arch::from_str(arch).canonical_name().to_string() -} - /// Map ecr architecture names to distro-specific names pub fn map_arch_for_distro(distro: &str, arch: &str) -> String { let arch_enum = Arch::from_str(arch);