use crate::schema::decoded::{Decoded, Hex};
use crate::schema::key::Key;
use std::collections::HashMap;
pub(super) struct KeysIter<'a> {
pub(super) keyids_iter: std::slice::Iter<'a, Decoded<Hex>>,
pub(super) keys: &'a HashMap<Decoded<Hex>, Key>,
}
impl<'a> Iterator for KeysIter<'a> {
type Item = &'a Key;
fn next(&mut self) -> Option<Self::Item> {
self.keyids_iter
.next()
.and_then(|keyid| self.keys.get(keyid))
}
}