Only save first part off all archives.
This commit is contained in:
12
src/main.rs
12
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user