From 6d54baefdf49fdeb4c73161a96131fa53174a092 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 21 Apr 2023 14:19:23 +0200 Subject: [PATCH] style: use clear over truncate(0) (#2338) --- crates/stages/src/stages/sender_recovery.rs | 2 +- crates/stages/src/stages/tx_lookup.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/stages/src/stages/sender_recovery.rs b/crates/stages/src/stages/sender_recovery.rs index 2726e0a34..2c8d30f7c 100644 --- a/crates/stages/src/stages/sender_recovery.rs +++ b/crates/stages/src/stages/sender_recovery.rs @@ -123,7 +123,7 @@ impl Stage for SenderRecoveryStage { rayon::spawn(move || { let mut rlp_buf = Vec::with_capacity(128); for entry in chunk { - rlp_buf.truncate(0); + rlp_buf.clear(); let _ = tx.send(recover(entry, &mut rlp_buf)); } }); diff --git a/crates/stages/src/stages/tx_lookup.rs b/crates/stages/src/stages/tx_lookup.rs index aa5ea497f..b804f6e42 100644 --- a/crates/stages/src/stages/tx_lookup.rs +++ b/crates/stages/src/stages/tx_lookup.rs @@ -99,7 +99,7 @@ impl Stage for TransactionLookupStage { rayon::spawn(move || { let mut rlp_buf = Vec::with_capacity(128); for entry in chunk { - rlp_buf.truncate(0); + rlp_buf.clear(); let _ = tx.send(calculate_hash(entry, &mut rlp_buf)); } });