Skip to content

Commit

Permalink
Merge pull request #185 from omnv/patch-1
Browse files Browse the repository at this point in the history
Add `.als` file support
  • Loading branch information
phiresky authored Sep 25, 2023
2 parents 16b2059 + 29cfa2b commit 6d32bb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[default.extend-words]
als = "als"
8 changes: 4 additions & 4 deletions src/adapters/decompress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tokio::io::BufReader;

use std::path::{Path, PathBuf};

static EXTENSIONS: &[&str] = &["tgz", "tbz", "tbz2", "gz", "bz2", "xz", "zst"];
static EXTENSIONS: &[&str] = &["als", "bz2", "gz", "tbz", "tbz2", "tgz", "xz", "zst"];
static MIME_TYPES: &[&str] = &[
"application/gzip",
"application/x-bzip",
Expand Down Expand Up @@ -62,10 +62,10 @@ fn decompress_any(reason: &FileMatcher, inp: ReadBox) -> Result<ReadBox> {

Ok(match reason {
Fast(FileExtension(ext)) => match ext.as_ref() {
"tgz" | "gz" => gz(inp),
"tbz" | "tbz2" | "bz2" => bz2(inp),
"xz" => xz(inp),
"als" | "gz" | "tgz" => gz(inp),
"bz2" | "tbz" | "tbz2" => bz2(inp),
"zst" => zst(inp),
"xz" => xz(inp),
ext => Err(format_err!("don't know how to decompress {}", ext))?,
},
MimeType(mime) => match mime.as_ref() {
Expand Down

0 comments on commit 6d32bb7

Please sign in to comment.