Skip to content

Commit

Permalink
turbune: Use Arc::unwrap_or_clone(). (#1333)
Browse files Browse the repository at this point in the history
It is stable since Rust 1.76.0.
  • Loading branch information
ilya-bobyr authored May 14, 2024
1 parent 59e3eaa commit c0e51b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion turbine/src/broadcast_stage/standard_broadcast_run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl StandardBroadcastRun {
) {
// Insert shreds into blockstore
let insert_shreds_start = Instant::now();
let mut shreds = Arc::try_unwrap(shreds).unwrap_or_else(|shreds| (*shreds).clone());
let mut shreds = Arc::unwrap_or_clone(shreds);
// The first data shred is inserted synchronously.
// https://github.com/solana-labs/solana/blob/92a0b310c/turbine/src/broadcast_stage/standard_broadcast_run.rs#L268-L283
if let Some(shred) = shreds.first() {
Expand Down

0 comments on commit c0e51b4

Please sign in to comment.