use &[T] instead of Vec<T> where appropriate
clippy
This commit is contained in:
@ -683,14 +683,14 @@ impl<F: FnMut(Request<()>) -> InterceptedRequestResult> BigTable<F> {
|
|||||||
pub async fn get_protobuf_or_bincode_cells<B, P>(
|
pub async fn get_protobuf_or_bincode_cells<B, P>(
|
||||||
&mut self,
|
&mut self,
|
||||||
table: &str,
|
table: &str,
|
||||||
row_keys: Vec<RowKey>,
|
row_keys: &[RowKey],
|
||||||
) -> Result<Vec<(RowKey, CellData<B, P>)>>
|
) -> Result<Vec<(RowKey, CellData<B, P>)>>
|
||||||
where
|
where
|
||||||
B: serde::de::DeserializeOwned,
|
B: serde::de::DeserializeOwned,
|
||||||
P: prost::Message + Default,
|
P: prost::Message + Default,
|
||||||
{
|
{
|
||||||
Ok(self
|
Ok(self
|
||||||
.get_multi_row_data(table, row_keys.as_slice())
|
.get_multi_row_data(table, row_keys)
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(key, row_data)| {
|
.map(|(key, row_data)| {
|
||||||
|
@ -458,7 +458,7 @@ impl LedgerStorage {
|
|||||||
// Fetches and gets a vector of confirmed blocks via a multirow fetch
|
// Fetches and gets a vector of confirmed blocks via a multirow fetch
|
||||||
pub async fn get_confirmed_blocks_with_data(
|
pub async fn get_confirmed_blocks_with_data(
|
||||||
&self,
|
&self,
|
||||||
slots: Vec<Slot>,
|
slots: &[Slot],
|
||||||
) -> Result<Vec<(Slot, ConfirmedBlock)>> {
|
) -> Result<Vec<(Slot, ConfirmedBlock)>> {
|
||||||
debug!(
|
debug!(
|
||||||
"LedgerStorage::get_confirmed_blocks_with_data request received: {:?}",
|
"LedgerStorage::get_confirmed_blocks_with_data request received: {:?}",
|
||||||
@ -466,11 +466,11 @@ impl LedgerStorage {
|
|||||||
);
|
);
|
||||||
inc_new_counter_debug!("storage-bigtable-query", 1);
|
inc_new_counter_debug!("storage-bigtable-query", 1);
|
||||||
let mut bigtable = self.connection.client();
|
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
|
let data: Vec<(Slot, ConfirmedBlock)> = bigtable
|
||||||
.get_protobuf_or_bincode_cells::<StoredConfirmedBlock, generated::ConfirmedBlock>(
|
.get_protobuf_or_bincode_cells::<StoredConfirmedBlock, generated::ConfirmedBlock>(
|
||||||
"blocks",
|
"blocks",
|
||||||
row_keys.clone(),
|
row_keys.as_slice(),
|
||||||
)
|
)
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
Reference in New Issue
Block a user