We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea988ad commit c208bacCopy full SHA for c208bac
exercises/book-store/example.rs
@@ -10,7 +10,7 @@ type GroupedBasket = Vec<Group>;
10
type Price = u32;
11
const BOOK_PRICE: Price = 800;
12
13
-#[derive(Debug, Clone, PartialEq, Eq)]
+#[derive(Debug, Clone)]
14
struct Group(RefCell<BTreeSet<Book>>);
15
16
impl Group {
@@ -65,6 +65,14 @@ impl PartialOrd for Group {
65
}
66
67
68
+impl PartialEq for Group {
69
+ fn eq(&self, other: &Group) -> bool {
70
+ self.0.borrow().eq(&other.0.borrow())
71
+ }
72
+}
73
+
74
+impl Eq for Group {}
75
76
impl Hash for Group {
77
fn hash<H: Hasher>(&self, hasher: &mut H) {
78
self.0.borrow().hash(hasher);
0 commit comments