From fbcf6a08022222b0ac5fde4f7422b3138353eabe Mon Sep 17 00:00:00 2001 From: Edgar Xi Date: Mon, 14 Mar 2022 16:15:19 -0400 Subject: [PATCH] use &[T] instead of Vec where appropriate clippy --- storage-bigtable/src/bigtable.rs | 4 ++-- storage-bigtable/src/lib.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/storage-bigtable/src/bigtable.rs b/storage-bigtable/src/bigtable.rs index 6b60c66439..23c6719872 100644 --- a/storage-bigtable/src/bigtable.rs +++ b/storage-bigtable/src/bigtable.rs @@ -683,14 +683,14 @@ impl) -> InterceptedRequestResult> BigTable { pub async fn get_protobuf_or_bincode_cells( &mut self, table: &str, - row_keys: Vec, + row_keys: &[RowKey], ) -> Result)>> where B: serde::de::DeserializeOwned, P: prost::Message + Default, { Ok(self - .get_multi_row_data(table, row_keys.as_slice()) + .get_multi_row_data(table, row_keys) .await? .into_iter() .map(|(key, row_data)| { diff --git a/storage-bigtable/src/lib.rs b/storage-bigtable/src/lib.rs index 7416f4adb7..123793a20b 100644 --- a/storage-bigtable/src/lib.rs +++ b/storage-bigtable/src/lib.rs @@ -458,7 +458,7 @@ impl LedgerStorage { // Fetches and gets a vector of confirmed blocks via a multirow fetch pub async fn get_confirmed_blocks_with_data( &self, - slots: Vec, + slots: &[Slot], ) -> Result> { debug!( "LedgerStorage::get_confirmed_blocks_with_data request received: {:?}", @@ -466,11 +466,11 @@ impl LedgerStorage { ); inc_new_counter_debug!("storage-bigtable-query", 1); let mut bigtable = self.connection.client(); - let row_keys: Vec = slots.into_iter().map(slot_to_blocks_key).collect(); + let row_keys: Vec = slots.iter().copied().map(slot_to_blocks_key).collect(); let data: Vec<(Slot, ConfirmedBlock)> = bigtable .get_protobuf_or_bincode_cells::( "blocks", - row_keys.clone(), + row_keys.as_slice(), ) .await? .into_iter()