summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-10-31 23:31:03 +0100
committerGitHub <noreply@github.com>2016-10-31 23:31:03 +0100
commitfa64c2d27dc4b9afbfa7d077ed7821e7688e0339 (patch)
tree4372569ef00eea2e648c88d9e927dd9f281c5620
parent85e95d142cc40f18df0da6a08e07ce6873394516 (diff)
parentaa0f496474ab89a58c9ca94667977c12f2267d58 (diff)
downloadimag-fa64c2d27dc4b9afbfa7d077ed7821e7688e0339.zip
imag-fa64c2d27dc4b9afbfa7d077ed7821e7688e0339.tar.gz
Merge pull request #827 from matthiasbeyer/libimagstore/store-id-cmp-without-base
Impl PartialEq for StoreId
-rw-r--r--libimagstore/src/storeid.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/libimagstore/src/storeid.rs b/libimagstore/src/storeid.rs
index 8a3623c..72e75d3 100644
--- a/libimagstore/src/storeid.rs
+++ b/libimagstore/src/storeid.rs
@@ -33,12 +33,18 @@ use error::MapErrInto;
use store::Result;
/// The Index into the Store
-#[derive(Debug, Clone, PartialEq, Hash, Eq, PartialOrd, Ord)]
+#[derive(Debug, Clone, Hash, Eq, PartialOrd, Ord)]
pub struct StoreId {
base: Option<PathBuf>,
id: PathBuf,
}
+impl PartialEq for StoreId {
+ fn eq(&self, other: &StoreId) -> bool {
+ self.id == other.id
+ }
+}
+
impl StoreId {
pub fn new(base: Option<PathBuf>, id: PathBuf) -> Result<StoreId> {