aboutsummaryrefslogtreecommitdiff
path: root/src/dictionary.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dictionary.rs')
-rw-r--r--src/dictionary.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dictionary.rs b/src/dictionary.rs
index a8d9b28..b522c9e 100644
--- a/src/dictionary.rs
+++ b/src/dictionary.rs
@@ -31,8 +31,8 @@ impl Dictionary {
}
}
- pub fn get(&self, name : String) -> u64 {
- *self.data.get(&name).unwrap()
+ pub fn get(&self, name : String) -> Option<&u64> {
+ self.data.get(&name)
}
pub fn iter(&self) -> &HashMap<String, u64> {
@@ -55,7 +55,7 @@ impl Dictionary {
let mut fv = FileVector::new();
for word in words {
- let i = self.get(word);
+ let i = *self.get(word).unwrap();
if !fv.contains_key(&i) {
fv.insert(i, 1);
} else {