diff --git a/bin/main.rs b/bin/main.rs index 2292bca..85e89e6 100644 --- a/bin/main.rs +++ b/bin/main.rs @@ -49,8 +49,8 @@ struct Opt { fn main() { let args = Opt::from_args(); let f = filter::Filter::new( - args.keywords.clone().as_slice(), - args.not.clone().as_slice(), + args.keywords.as_slice(), + args.not.as_slice(), args.or_filter, ); diff --git a/src/filter.rs b/src/filter.rs index ea0e63e..7e5f593 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -168,7 +168,6 @@ impl Filter { Some(val) => *val += 1, None => { tagmap.insert(tag, 1); - () } } } diff --git a/src/utility.rs b/src/utility.rs index 855d933..434401a 100644 --- a/src/utility.rs +++ b/src/utility.rs @@ -1,4 +1,3 @@ -use lazy_static; use std::collections::BTreeSet as Set; use std::fs::File; use std::io::Read; @@ -20,10 +19,8 @@ pub fn get_files(root: Option) -> Result, PatternError> { let txts = glob(&format!("{}/**/*.txt", dir))?; let mds = glob(&format!("{}/**/*.md", dir))?; let orgs = glob(&format!("{}/**/*.org", dir))?; - for filename in txts.chain(mds).chain(orgs) { - if let Ok(fname) = filename { - files.push(fname.to_string_lossy().into()); - } + for filename in txts.chain(mds).chain(orgs).flatten() { + files.push(filename.to_string_lossy().into()); } Ok(files) }