From c0e51b4fd3e5fe21b9117806efb658a2efaf8577 Mon Sep 17 00:00:00 2001 From: Illia Bobyr Date: Tue, 14 May 2024 16:45:21 -0700 Subject: [PATCH] turbune: Use `Arc::unwrap_or_clone()`. (#1333) It is stable since Rust 1.76.0. --- turbine/src/broadcast_stage/standard_broadcast_run.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbine/src/broadcast_stage/standard_broadcast_run.rs b/turbine/src/broadcast_stage/standard_broadcast_run.rs index 57163e56d7d8af..8e948ce8e85947 100644 --- a/turbine/src/broadcast_stage/standard_broadcast_run.rs +++ b/turbine/src/broadcast_stage/standard_broadcast_run.rs @@ -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() {