aboutsummaryrefslogtreecommitdiff
path: root/src/filecache.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/filecache.rs')
-rw-r--r--src/filecache.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/filecache.rs b/src/filecache.rs
index f8d84ec..a352e58 100644
--- a/src/filecache.rs
+++ b/src/filecache.rs
@@ -1,10 +1,26 @@
+use std::hash::{Hasher, Hash};
+
use crate::vector::FileVector;
/// Represents one file which was indexed.
-#[derive(Clone, Debug)]
+#[derive(Clone, Debug, Default)]
pub struct FileCache {
- pub vector : FileVector,
pub path : String,
+ pub vector : FileVector,
+}
+
+impl PartialEq for FileCache {
+ fn eq(&self, other : &Self) -> bool {
+ self.path == other.path
+ }
+}
+
+impl Eq for FileCache { }
+
+impl Hash for FileCache {
+ fn hash<H: Hasher>(&self, state: &mut H) {
+ self.path.hash(state);
+ }
}
impl FileCache {