File tree 1 file changed +3
-2
lines changed
crates/matrix-sdk-base/src/store/sled_store
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ mod store_key;
17
17
use std:: {
18
18
collections:: BTreeSet ,
19
19
convert:: { TryFrom , TryInto } ,
20
+ mem:: size_of,
20
21
path:: { Path , PathBuf } ,
21
22
sync:: Arc ,
22
23
time:: Instant ,
@@ -210,7 +211,7 @@ impl BatchIdx {
210
211
Self ( self . 0 + 1 )
211
212
}
212
213
213
- fn to_be_bytes ( self ) -> [ u8 ; 8 ] {
214
+ fn to_be_bytes ( self ) -> [ u8 ; size_of :: < usize > ( ) ] {
214
215
self . 0 . to_be_bytes ( )
215
216
}
216
217
}
@@ -236,7 +237,7 @@ struct EventPosition {
236
237
237
238
impl From < sled:: IVec > for EventPosition {
238
239
fn from ( item : sled:: IVec ) -> Self {
239
- let ( first, second) = item. split_at ( std :: mem :: size_of :: < usize > ( ) ) ;
240
+ let ( first, second) = item. split_at ( size_of :: < usize > ( ) ) ;
240
241
241
242
let batch_idx = BatchIdx ( usize:: from_be_bytes (
242
243
first. try_into ( ) . expect ( "The event position wasn't properly encoded" ) ,
You can’t perform that action at this time.
0 commit comments