Skip to content

Commit

Permalink
clippy: readonly_write_lock (anza-xyz#1336)
Browse files Browse the repository at this point in the history
* clippy: readonly_write_lock

* add some comment

* update comments
  • Loading branch information
yihau authored May 16, 2024
1 parent 84b8429 commit 4d5ad77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11016,6 +11016,10 @@ pub mod tests {
let slot = shreds[0].slot();
// Grab this lock to block `get_slot_entries` before it fetches completed datasets
// and then mark the slot as dead, but full, by inserting carefully crafted shreds.

#[allow(clippy::readonly_write_lock)]
// Possible clippy bug, the lock is unused so clippy shouldn't care
// about read vs. write lock
let _lowest_cleanup_slot =
blockstore.lowest_cleanup_slot.write().unwrap();
blockstore.insert_shreds(shreds, None, false).unwrap();
Expand Down

0 comments on commit 4d5ad77

Please sign in to comment.