We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25813de commit ccae97bCopy full SHA for ccae97b
src/buffers/disk.rs
@@ -18,6 +18,7 @@ use snafu::{ResultExt, Snafu};
18
use std::collections::VecDeque;
19
use std::convert::TryInto;
20
use std::io;
21
+use std::mem::size_of;
22
use std::path::{Path, PathBuf};
23
use std::sync::{
24
atomic::{AtomicUsize, Ordering},
@@ -47,7 +48,7 @@ struct Key(usize);
47
48
49
impl db_key::Key for Key {
50
fn from_u8(key: &[u8]) -> Self {
- let bytes: [u8; 8] = key.try_into().expect("Key should be the right size");
51
+ let bytes: [u8; size_of::<usize>()] = key.try_into().expect("Key should be the right size");
52
53
Self(usize::from_be_bytes(bytes))
54
}
0 commit comments