InMemAccountsIndex iter returns vec<owned> (#19778)

This commit is contained in:
Jeff Washington (jwash)
2021-09-11 15:33:04 -05:00
committed by GitHub
parent 7de2236284
commit 91c3b18e1e
3 changed files with 7 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
use crate::accounts_index::{AccountMapEntry, IsCached};
use solana_sdk::pubkey::Pubkey;
use std::collections::{
hash_map::{Entry, Iter, Keys},
hash_map::{Entry, Keys},
HashMap,
};
use std::fmt::Debug;
@@ -26,8 +26,8 @@ impl<V: IsCached> InMemAccountsIndex<V> {
self.map.entry(pubkey)
}
pub fn iter(&self) -> Iter<K, AccountMapEntry<V>> {
self.map.iter()
pub fn items(&self) -> Vec<(K, AccountMapEntry<V>)> {
self.map.iter().map(|(k, v)| (*k, v.clone())).collect()
}
pub fn keys(&self) -> Keys<K, AccountMapEntry<V>> {