Use explicit dyn trait object

This commit is contained in:
Oliver Scherer 2018-11-27 16:20:15 +01:00
parent edc2fb5f60
commit 5958fa6a70

View File

@ -18,7 +18,7 @@ use crate::AllocMap;
pub struct MonoHashMap<K: Hash + Eq, V>(RefCell<FxHashMap<K, Box<V>>>);
impl<K: Hash + Eq, V> MonoHashMap<K, V> {
pub fn values<T>(&self, f: impl FnOnce(&mut Iterator<Item=&V>) -> T) -> T {
pub fn values<T>(&self, f: impl FnOnce(&mut dyn Iterator<Item=&V>) -> T) -> T {
f(&mut self.0.borrow().values().map(|v| &**v))
}
}