From 8a1b21ff73c8899c640537a2cec7729eceee93d6 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Fri, 20 Jan 2023 11:40:16 -0800 Subject: [PATCH] backend: implement equality for commits and trees It can be useful in tests to be able to compare two commits or trees. Most other structs already implement equality. --- lib/src/backend.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/backend.rs b/lib/src/backend.rs index bb5511459..c7b3870f6 100644 --- a/lib/src/backend.rs +++ b/lib/src/backend.rs @@ -138,7 +138,7 @@ content_hash! { } content_hash! { - #[derive(Debug, Clone)] + #[derive(Debug, PartialEq, Eq, Clone)] pub struct Commit { pub parents: Vec, pub predecessors: Vec, @@ -291,7 +291,7 @@ impl<'a> Iterator for TreeEntriesNonRecursiveIterator<'a> { } content_hash! { - #[derive(Default, Debug, Clone)] + #[derive(Default, PartialEq, Eq, Debug, Clone)] pub struct Tree { entries: BTreeMap, }