book-store: explicitly implement PartialEq
clippy:
error: you are implementing `Hash` explicitly but have derived `PartialEq`
note: `#[deny(clippy::derive_hash_xor_eq)]` on by default
help: for further information visit
@@ -10,7 +10,7 @@ type GroupedBasket = Vec<Group>;
type Price = u32;
const BOOK_PRICE: Price = 800;
-#[derive(Debug, Clone, PartialEq, Eq)]
+#[derive(Debug, Clone)]
struct Group(RefCell<BTreeSet<Book>>);
impl Group {
@@ -65,6 +65,14 @@ impl PartialOrd for Group {
}
}
+impl PartialEq for Group {
+ fn eq(&self, other: &Group) -> bool {
+ self.0.borrow().eq(&other.0.borrow())
+ }
+}
+
+impl Eq for Group {}
+
impl Hash for Group {
fn hash<H: Hasher>(&self, hasher: &mut H) {
self.0.borrow().hash(hasher);
