From 40c1c1f4e18609aadd9a438850ae80cee3ff6494 Mon Sep 17 00:00:00 2001 From: oxalica Date: Wed, 2 Jul 2025 02:47:32 -0400 Subject: [PATCH] fix: clippy warnings --- src/archive/squashfs.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/archive/squashfs.rs b/src/archive/squashfs.rs index d8953c0..60d4b44 100644 --- a/src/archive/squashfs.rs +++ b/src/archive/squashfs.rs @@ -90,7 +90,7 @@ pub fn unpack_archive(archive: FilesystemReader<'_>, output_folder: &Path, quiet let target = &symlink.link; #[cfg(unix)] { - std::os::unix::fs::symlink(&target, &file_path)?; + std::os::unix::fs::symlink(target, &file_path)?; filetime_creation::set_symlink_file_times(&file_path, mtime, mtime, mtime)?; // Note: Symlink permissions are ignored on *NIX anyway. No need to set them. } @@ -138,6 +138,8 @@ pub fn unpack_archive(archive: FilesystemReader<'_>, output_folder: &Path, quiet Ok(unpacked_files) } +// Re-assignments work bettwe with `cfg` blocks. +#[allow(clippy::field_reassign_with_default)] pub fn build_archive_from_paths( input_filenames: &[PathBuf], output_path: &Path, @@ -258,7 +260,7 @@ where } if !quiet { - info(format!("Compressing data")); + info("Compressing data".to_string()); } // Finalize the superblock and write data. This should be done before @@ -330,7 +332,7 @@ impl io::Read for LazyFile { } LazyFile::Opened(file) => { let cnt = file.read(buf)?; - if buf.len() != 0 && cnt == 0 { + if !buf.is_empty() && cnt == 0 { *self = Self::Closed; } Ok(cnt)