Use function pointers for iterators.

This commit is contained in:
Stephen Chung
2020-05-20 19:27:23 +08:00
parent 55ee4d6a19
commit 80fcc40710
6 changed files with 23 additions and 57 deletions

View File

@@ -83,7 +83,7 @@ impl PackagesCollection {
self.packages.iter().any(|p| p.contains_iter(id))
}
/// Get the specified TypeId iterator.
pub fn get_iter(&self, id: TypeId) -> Option<&IteratorFn> {
pub fn get_iter(&self, id: TypeId) -> Option<IteratorFn> {
self.packages
.iter()
.map(|p| p.get_iter(id))