diff --git a/Cargo.lock b/Cargo.lock index 566d83c..76d4169 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -638,9 +638,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] diff --git a/src/lib/extractors.rs b/src/lib/extractors.rs index 1602a28..cb7cd09 100644 --- a/src/lib/extractors.rs +++ b/src/lib/extractors.rs @@ -5,6 +5,8 @@ use bzip2::read::BzDecoder; use unrar::Archive; use ar; + +//TODO: P:1 refactor and extract like code /// Extracts files from a ZIP archive. /// /// # Arguments @@ -367,7 +369,24 @@ pub fn extract_txz(input_path: &Path, output_directory: &Path) -> Result<(), io: } Ok(()) } - +//TODO: P:5 add cargo doc +/// Extracts files from a DEB (.deb) compressed archive. +/// +/// # Arguments +/// +/// * `input_path` - The path to the DEB compressed file to extract. +/// +/// # Returns +/// +/// Returns `Ok(())` on success. +/// +/// # Examples +/// +/// ``` +/// use std::path::Path; +/// let result = extract_deb(Path::new("src/test_data/test.deb")); +/// assert!(result.is_ok()); +/// ``` pub fn extract_deb(input_path: &Path,) -> Result<(),io::Error>{ let input_file =File::open(&input_path).unwrap(); // Read an archive from the file foo.a: diff --git a/src/main.rs b/src/main.rs index 6222681..1f65b97 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,8 @@ use sk_extract::extractors::{ // extract_xar, // extract_exe }; + + fn main() { std::process::exit(run()); }