diff --git a/src/main.rs b/src/main.rs index 3d7ac1f..cf912cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,8 @@ extern crate structopt_derive; extern crate unrar; extern crate walkdir; +use std::collections::HashSet; + use mime_guess::guess_mime_type; use unrar::archive; use structopt::StructOpt; @@ -53,7 +55,15 @@ fn main() { .filter(is_file) .filter(is_archive); + let mut archives = HashSet::new(); + for entry in entries { - println!("{:?}", entry); + if let Some(path) = entry.path().to_str() { + let mut archive = archive::Archive::new(String::from(path)); + + archives.insert(archive.first_part()); + } } + + println!("{:#?}", archives); }