diff --git a/mini-lsm-mvcc/src/mem_table.rs b/mini-lsm-mvcc/src/mem_table.rs index 92d90d76..b7e0d77e 100644 --- a/mini-lsm-mvcc/src/mem_table.rs +++ b/mini-lsm-mvcc/src/mem_table.rs @@ -93,7 +93,7 @@ impl MemTable { /// Get a value by key. Should not be used in week 3. pub fn get(&self, key: KeySlice) -> Option { let key_bytes = KeyBytes::from_bytes_with_ts( - Bytes::from_static(unsafe { std::mem::transmute(key.key_ref()) }), + Bytes::from_static(unsafe { std::mem::transmute::<&[u8], &[u8]>(key.key_ref()) }), key.ts(), ); self.map.get(&key_bytes).map(|e| e.value().clone())