diff --git a/Cargo.lock b/Cargo.lock index d5c0b78..265a1cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,7 @@ dependencies = [ [[package]] name = "acridotheres" -version = "0.4.0" +version = "0.4.1" dependencies = [ "acr", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 8197b0e..121f5c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'acridotheres' -version = '0.4.0' +version = '0.4.1' edition = '2021' description = "Acridotheres Core Library" license = "MIT" diff --git a/src/formats/auto.rs b/src/formats/auto.rs index 4db50ee..fe71563 100644 --- a/src/formats/auto.rs +++ b/src/formats/auto.rs @@ -19,3 +19,11 @@ pub fn detect( ) -> Result { Err(Error::new(ErrorKind::Other, "Failed to detect format")) } + +pub fn from_str(s: &str) -> Option { + use Format::*; + match s { + "zip" => Some(Zip), + _ => None, + } +}