Skip to content

Commit a3ac0be

Browse files
Newbyteejsparber
authored andcommitted
base: fix 32-bit compilation
1 parent 6bd2ca8 commit a3ac0be

File tree

1 file changed

+3
-2
lines changed
  • crates/matrix-sdk-base/src/store/sled_store

1 file changed

+3
-2
lines changed

crates/matrix-sdk-base/src/store/sled_store/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mod store_key;
1717
use std::{
1818
collections::BTreeSet,
1919
convert::{TryFrom, TryInto},
20+
mem::size_of,
2021
path::{Path, PathBuf},
2122
sync::Arc,
2223
time::Instant,
@@ -210,7 +211,7 @@ impl BatchIdx {
210211
Self(self.0 + 1)
211212
}
212213

213-
fn to_be_bytes(self) -> [u8; 8] {
214+
fn to_be_bytes(self) -> [u8; size_of::<usize>()] {
214215
self.0.to_be_bytes()
215216
}
216217
}
@@ -236,7 +237,7 @@ struct EventPosition {
236237

237238
impl From<sled::IVec> for EventPosition {
238239
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>());
240241

241242
let batch_idx = BatchIdx(usize::from_be_bytes(
242243
first.try_into().expect("The event position wasn't properly encoded"),

0 commit comments

Comments
 (0)