diff options
author | Dean Li <deantvv@gmail.com> | 2021-04-11 03:00:16 +0000 |
---|---|---|
committer | Dean Li <deantvv@gmail.com> | 2021-04-11 03:00:16 +0000 |
commit | 2bae301ed8efcf4239849a45b94cdc42e398b905 (patch) | |
tree | 06cfbebfc33cca930a80b9c080de3af1dcfdc815 /src/archive.rs | |
parent | Merge pull request #488 from svenstaro/dependabot/cargo/http-0.2.4 (diff) | |
download | miniserve-2bae301ed8efcf4239849a45b94cdc42e398b905.tar.gz miniserve-2bae301ed8efcf4239849a45b94cdc42e398b905.zip |
Separate tar archive and tar flags
It used to have one flag (-r) to enable both tar archive and tar.
Now it has two flags [ -r: for tar, -g: for tar archive].
Related to #451
Diffstat (limited to 'src/archive.rs')
-rw-r--r-- | src/archive.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/archive.rs b/src/archive.rs index 4df3a31..28d26b5 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -53,10 +53,15 @@ impl CompressionMethod { } } - pub fn is_enabled(self, tar_enabled: bool, zip_enabled: bool) -> bool { + pub fn is_enabled( + self, + tar_enabled: bool, + tar_archive_enabled: bool, + zip_enabled: bool, + ) -> bool { match self { - CompressionMethod::TarGz => tar_enabled, CompressionMethod::Tar => tar_enabled, + CompressionMethod::TarGz => tar_archive_enabled, CompressionMethod::Zip => zip_enabled, } } |