fix: clippy lint (#80)

* clippy(merge_iterator): fix `clippy::non_canonical_partial_ord_impl` lint.

* clippy(bloom): fix `clippy::manual_clamp` lint.

* clippy(compact): fix `clippy::assigning_clones` lint.

* clippy(key): fix `clippy::legacy_numeric_constants` lint.

* clippy(mem_table): fix `clippy::missing_transmute_annotations` lint.
This commit is contained in:
Foreverhighness
2024-06-24 00:45:56 +08:00
committed by GitHub
parent 2fb3932fb1
commit aa35a96dfc
10 changed files with 31 additions and 37 deletions

View File

@@ -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<Bytes> {
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())