| 1 | struct MyStructDiff<'__daft> { |
| 2 | a: ::daft::Leaf<&'__daft i32>, |
| 3 | } |
| 4 | impl<'__daft> ::core::fmt::Debug for MyStructDiff<'__daft> |
| 5 | where |
| 6 | ::daft::Leaf<&'__daft i32>: ::core::fmt::Debug, |
| 7 | { |
| 8 | fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { |
| 9 | f.debug_struct(stringify!(MyStructDiff)).field(stringify!(a), &self.a).finish() |
| 10 | } |
| 11 | } |
| 12 | impl<'__daft> ::core::cmp::PartialEq for MyStructDiff<'__daft> |
| 13 | where |
| 14 | ::daft::Leaf<&'__daft i32>: ::core::cmp::PartialEq, |
| 15 | { |
| 16 | fn eq(&self, other: &Self) -> bool { |
| 17 | self.a == other.a |
| 18 | } |
| 19 | } |
| 20 | impl<'__daft> ::core::cmp::Eq for MyStructDiff<'__daft> |
| 21 | where |
| 22 | ::daft::Leaf<&'__daft i32>: ::core::cmp::Eq, |
| 23 | {} |
| 24 | impl ::daft::Diffable for MyStruct { |
| 25 | type Diff<'__daft> = MyStructDiff<'__daft> where Self: '__daft; |
| 26 | fn diff<'__daft>(&'__daft self, other: &'__daft Self) -> MyStructDiff<'__daft> { |
| 27 | Self::Diff { |
| 28 | a: ::daft::Leaf { |
| 29 | before: &self.a, |
| 30 | after: &other.a, |
| 31 | }, |
| 32 | } |
| 33 | } |
| 34 | } |