Use xz2 instead of liblzma, update dependencies

This commit is contained in:
Jeremy Soller 2025-03-31 09:05:32 -06:00
parent c665cf3522
commit 28ec74d440
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA
5 changed files with 127 additions and 119 deletions

View file

@ -189,9 +189,9 @@ pub fn context_menu<'a>(
"application/x-bzip",
#[cfg(feature = "bzip2")]
"application/x-bzip-compressed-tar",
#[cfg(feature = "liblzma")]
#[cfg(feature = "xz2")]
"application/x-xz",
#[cfg(feature = "liblzma")]
#[cfg(feature = "xz2")]
"application/x-xz-compressed-tar",
]
.iter()

View file

@ -75,7 +75,7 @@ pub fn mime_icon(mime: Mime, size: u16) -> icon::Handle {
}
pub fn parent_mime_types(mime: &Mime) -> Option<Vec<Mime>> {
let mut mime_icon_cache = MIME_ICON_CACHE.lock().unwrap();
let mime_icon_cache = MIME_ICON_CACHE.lock().unwrap();
mime_icon_cache.shared_mime_info.get_parents_aliased(mime)
}

View file

@ -135,7 +135,7 @@ fn zip_extract<R: io::Read + io::Seek, P: AsRef<Path>>(
.map_err(|e| e)?;
let filepath = file
.enclosed_name()
.ok_or(ZipError::InvalidArchive("Invalid file path"))?;
.ok_or(ZipError::InvalidArchive("Invalid file path".into()))?;
let outpath = directory.as_ref().join(filepath);
@ -986,11 +986,11 @@ impl Operation {
.and_then(|mut archive| archive.unpack(&new_dir))
.map_err(OperationError::from_str)?
}
#[cfg(feature = "liblzma")]
#[cfg(feature = "xz2")]
"application/x-xz" | "application/x-xz-compressed-tar" => {
OpReader::new(path, controller)
.map(io::BufReader::new)
.map(liblzma::read::XzDecoder::new)
.map(xz2::read::XzDecoder::new)
.map(tar::Archive::new)
.and_then(|mut archive| archive.unpack(&new_dir))
.map_err(OperationError::from_str)?