fix: clippy

This commit is contained in:
2026-06-17 17:42:41 +02:00
parent f3aec10618
commit 49343e5811
2 changed files with 5 additions and 20 deletions
+5 -2
View File
@@ -214,7 +214,10 @@ fn check_kvm_capabilities() -> bool {
}
/// Create an uncompressed cpio initramfs from a directory
fn create_initramfs(rootfs: &PathBuf) -> Result<PathBuf> {
/// A filesystem entry for cpio archives: (name, mode, mtime, nlink, data)
type CpioEntry = (String, u32, u32, u32, Vec<u8>);
fn create_initramfs(rootfs: &Path) -> Result<PathBuf> {
// 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<Vec<(String, u32, u32, u32, Vec<u8>)>> {
) -> Result<Vec<CpioEntry>> {
let mut entries = Vec::new();
let mut total_data: u64 = 0;
-18
View File
@@ -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);