aboutsummaryrefslogtreecommitdiffstats
path: root/src/archive.rs
diff options
context:
space:
mode:
authorboasting-squirrel <boasting.squirrel@gmail.com>2019-04-07 10:21:58 +0000
committerboasting-squirrel <boasting.squirrel@gmail.com>2019-04-07 10:21:58 +0000
commitc24986640589df2aa5b2f7360cc8bea71ed49fbb (patch)
treef95d72cf6b1015ddbc8a7313bf256663ebc7e74f /src/archive.rs
parentFixed upload bug + refactored @ else in templates (diff)
downloadminiserve-c24986640589df2aa5b2f7360cc8bea71ed49fbb.tar.gz
miniserve-c24986640589df2aa5b2f7360cc8bea71ed49fbb.zip
Use strum_macros::EnumIter instead of manually listing Enum variants
Diffstat (limited to 'src/archive.rs')
-rw-r--r--src/archive.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/archive.rs b/src/archive.rs
index b1119f0..f588d56 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -6,11 +6,12 @@ use serde::Deserialize;
use std::io;
use std::path::PathBuf;
use tar::Builder;
+use strum_macros::EnumIter;
use crate::errors;
/// Available compression methods
-#[derive(Debug, Deserialize, Clone)]
+#[derive(Debug, Deserialize, Clone, EnumIter)]
pub enum CompressionMethod {
/// TAR GZ
#[serde(alias = "targz")]
@@ -25,11 +26,6 @@ impl CompressionMethod {
.to_string()
}
- /// Lists compression methods
- pub fn get_compression_methods() -> Vec<Self> {
- vec![CompressionMethod::TarGz]
- }
-
pub fn extension(&self) -> String {
match &self {
CompressionMethod::TarGz => "tar.gz",