summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-11-05 13:23:20 +0100
committerGitHub <noreply@github.com>2016-11-05 13:23:20 +0100
commitb210b0ec3edfc6269baedc2791d780b169975877 (patch)
tree7c307b92fd99ed08bc7bee5020998b119a4e90c9
parent002c50a39e2a4e9426b0f8cc4bc7cc0d7ed8d599 (diff)
parent303dd30ff29fb0b4e81563133235aadfb7cd3564 (diff)
downloadimag-b210b0ec3edfc6269baedc2791d780b169975877.zip
imag-b210b0ec3edfc6269baedc2791d780b169975877.tar.gz
Merge pull request #833 from matthiasbeyer/libimagstore/entry-eq
Libimagstore/entry eq
-rw-r--r--libimagstore/src/store.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/libimagstore/src/store.rs b/libimagstore/src/store.rs
index e07c9b2..eca2ea0 100644
--- a/libimagstore/src/store.rs
+++ b/libimagstore/src/store.rs
@@ -963,7 +963,7 @@ pub type EntryContent = String;
///
/// This is basically a wrapper around `toml::Table` which provides convenience to the user of the
/// library.
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, PartialEq)]
pub struct EntryHeader {
header: Value,
}
@@ -1558,6 +1558,16 @@ impl Entry {
}
+impl PartialEq for Entry {
+
+ fn eq(&self, other: &Entry) -> bool {
+ self.location == other.location && // As the location only compares from the store root
+ self.header == other.header && // and the other Entry could be from another store (not
+ self.content == other.content // implemented by now, but we think ahead here)
+ }
+
+}
+
mod glob_store_iter {
use std::fmt::{Debug, Formatter};
use std::fmt::Error as FmtError;