Skip to content

Commit f7b0694

Browse files
committed
suppress clippy
1 parent 558ea2b commit f7b0694

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ mod key_cache {
258258
}
259259

260260
let slot_idx = fx_hash(bytes) & (CAP - 1);
261+
// `&raw mut` is the supported path to a `static mut`; the explicit
262+
// re-borrow keeps the field accesses readable. Clippy's `deref_addrof`
263+
// suggestion would re-introduce `static_mut_refs`.
264+
#[allow(clippy::deref_addrof)]
261265
let slot = &mut *(&raw mut SLOTS[slot_idx]);
262266

263267
if slot.len as usize == bytes.len()
@@ -431,8 +435,7 @@ where
431435
prev_key = Some(key);
432436

433437
let (key_ptr, key_hash) = unsafe { key_cache::intern_key(py, key)? };
434-
let key_bound: Bound<'_, PyAny> =
435-
unsafe { Bound::from_owned_ptr(py, key_ptr) };
438+
let key_bound: Bound<'_, PyAny> = unsafe { Bound::from_owned_ptr(py, key_ptr) };
436439

437440
let value_py = decode_dag_cbor_to_pyobject(py, r, depth + 1)?;
438441

0 commit comments

Comments
 (0)