Skip to content

Commit

Permalink
feat: Added format from string function
Browse files Browse the repository at this point in the history
  • Loading branch information
Le0X8 committed Nov 23, 2024
1 parent 4d9680e commit 94f20fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'acridotheres'
version = '0.4.0'
version = '0.4.1'
edition = '2021'
description = "Acridotheres Core Library"
license = "MIT"
Expand Down
8 changes: 8 additions & 0 deletions src/formats/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ pub fn detect(
) -> Result<Format> {
Err(Error::new(ErrorKind::Other, "Failed to detect format"))
}

pub fn from_str(s: &str) -> Option<Format> {
use Format::*;
match s {
"zip" => Some(Zip),
_ => None,
}
}

0 comments on commit 94f20fe

Please sign in to comment.