File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
crates/matrix-sdk/src/event_cache Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,35 @@ pub enum LinkedChunkUpdate<Item, Gap> {
96
96
} ,
97
97
}
98
98
99
+ impl < Item , Gap > Clone for LinkedChunkUpdate < Item , Gap >
100
+ where
101
+ Item : Clone ,
102
+ Gap : Clone ,
103
+ {
104
+ fn clone ( & self ) -> Self {
105
+ match self {
106
+ Self :: NewItemsChunk { previous, new, next } => Self :: NewItemsChunk {
107
+ previous : previous. clone ( ) ,
108
+ new : new. clone ( ) ,
109
+ next : next. clone ( ) ,
110
+ } ,
111
+ Self :: NewGapChunk { previous, new, next, gap } => Self :: NewGapChunk {
112
+ previous : previous. clone ( ) ,
113
+ new : new. clone ( ) ,
114
+ next : next. clone ( ) ,
115
+ gap : gap. clone ( ) ,
116
+ } ,
117
+ Self :: RemoveChunk ( identifier) => Self :: RemoveChunk ( identifier. clone ( ) ) ,
118
+ Self :: InsertItems { at, items } => {
119
+ Self :: InsertItems { at : at. clone ( ) , items : items. clone ( ) }
120
+ }
121
+ Self :: TruncateItems { chunk, length } => {
122
+ Self :: TruncateItems { chunk : chunk. clone ( ) , length : length. clone ( ) }
123
+ }
124
+ }
125
+ }
126
+ }
127
+
99
128
/// A collection of [`LinkedChunkUpdate`].
100
129
///
101
130
/// Get a value for this type with [`LinkedChunk::updates`].
You can’t perform that action at this time.
0 commit comments