aboutsummaryrefslogtreecommitdiff
path: root/src/index.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-07-06 14:05:39 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2023-07-06 14:05:39 +0200
commit8c3c8efa428200c67c1a6fa731faee55adf19678 (patch)
tree40f96ad5bd9bb86c62a84bd05914afcf345c6a05 /src/index.rs
parent8799c886003d5eb0084589776ccafea809c451ff (diff)
cleanup with clippy
Diffstat (limited to 'src/index.rs')
-rw-r--r--src/index.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/index.rs b/src/index.rs
index 4fabe32..8c358d3 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -52,8 +52,8 @@ impl Index {
entry.path()
.to_str()
.unwrap()
- .replace(",", "\0"),
- fv.to_string()
+ .replace(',', "\0"),
+ fv.stringify()
).ok();
filecache.push(FileCache {
@@ -95,8 +95,8 @@ impl Index {
for line in reader.lines() {
let l = line.unwrap();
- if l.starts_with("#") {
- dict = Dictionary::from_line(&l.strip_prefix("#").unwrap());
+ if l.starts_with('#') {
+ dict = Dictionary::from_line(l.strip_prefix('#').unwrap());
} else {
filecache.push(FileCache::from_line(l));
}
@@ -112,9 +112,8 @@ impl Index {
let mut v : FileVector = FileVector::new();
for arg in search_args {
- match self.dictionary.get(arg.to_string()) {
- Some(value) => { v.insert(*value, 1); }
- None => {}
+ if let Some(value) = self.dictionary.get(arg.to_string()) {
+ v.insert(*value, 1);
}
}