Fix single format compression (#89)

Now working for formats that are not archives, like file.gz and file.xz
This commit is contained in:
João Marcos Bezerra 2021-10-14 18:17:52 -03:00 committed by GitHub
parent 1c24f41494
commit c89c34a91f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,7 +169,7 @@ fn compress_files(
) -> crate::Result<()> {
let file_writer = BufWriter::with_capacity(BUFFER_CAPACITY, output_file);
if formats.len() == 1 {
if let [Tar | Tgz | Zip] = *formats.as_slice() {
match formats[0] {
Tar => {
let mut bufwriter = archive::tar::build_archive_from_paths(&files, file_writer)?;