Skip to content

Commit

Permalink
Linted with clippy hints
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDavison committed Mar 10, 2021
1 parent e9caa11 commit 10f4a0d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bin/main.rs
Expand Up @@ -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,
);

Expand Down
1 change: 0 additions & 1 deletion src/filter.rs
Expand Up @@ -168,7 +168,6 @@ impl Filter {
Some(val) => *val += 1,
None => {
tagmap.insert(tag, 1);
()
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions src/utility.rs
@@ -1,4 +1,3 @@
use lazy_static;
use std::collections::BTreeSet as Set;
use std::fs::File;
use std::io::Read;
Expand All @@ -20,10 +19,8 @@ pub fn get_files(root: Option<String>) -> Result<Vec<String>, 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)
}
Expand Down

0 comments on commit 10f4a0d

Please sign in to comment.