use &[T] instead of Vec<T> where appropriate

clippy
This commit is contained in:
Edgar Xi 2022-03-14 16:15:19 -04:00 committed by Trent Nelson
parent 5533e9393c
commit fbcf6a0802
2 changed files with 5 additions and 5 deletions

View File

@ -683,14 +683,14 @@ impl<F: FnMut(Request<()>) -> InterceptedRequestResult> BigTable<F> {
pub async fn get_protobuf_or_bincode_cells<B, P>(
&mut self,
table: &str,
row_keys: Vec<RowKey>,
row_keys: &[RowKey],
) -> Result<Vec<(RowKey, CellData<B, P>)>>
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)| {

View File

@ -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<Slot>,
slots: &[Slot],
) -> Result<Vec<(Slot, ConfirmedBlock)>> {
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<RowKey> = slots.into_iter().map(slot_to_blocks_key).collect();
let row_keys: Vec<RowKey> = slots.iter().copied().map(slot_to_blocks_key).collect();
let data: Vec<(Slot, ConfirmedBlock)> = bigtable
.get_protobuf_or_bincode_cells::<StoredConfirmedBlock, generated::ConfirmedBlock>(
"blocks",
row_keys.clone(),
row_keys.as_slice(),
)
.await?
.into_iter()