pub fn iterate_assoc_items<T>(
        &self,
        db: &dyn HirDatabase,
        krate: Crate,
        mut callback: impl FnMut(AssocItem) -> Option<T>,
    ) -> Option<T> {
        let mut slot = None;
        self.iterate_assoc_items_dyn(db, krate, &mut |assoc_item_id| {
            slot = callback(assoc_item_id.into());
            slot.is_some()
        });
        slot
    }
// This would be nicer if it just returned an iterator, but that runs into
// lifetime problems, because we need to borrow temp `CrateImplDefs`.
This would be nicer if it just returned an iterator, but that runs into
lifetime problems, because we need to borrow temp `CrateImplDefs`.
This would be nicer if it just returned an iterator but that runs into lifetime problems because we need to borrow temp ` CrateImplDefs ` .
pub fn iterate_assoc_items<T>(
        &self,
        db: &dyn HirDatabase,
        krate: Crate,
        mut callback: impl FnMut(AssocItem) -> Option<T>,
    ) -> Option<T> {
        let mut slot = None;
        self.iterate_assoc_items_dyn(db, krate, &mut |assoc_item_id| {
            slot = callback(assoc_item_id.into());
            slot.is_some()
        });
        slot
    }
pub fn iterate_assoc_items < T > ( & self , db : & dyn HirDatabase , krate : Crate , mut callback : impl FnMut ( AssocItem ) -> Option < T > , ) -> Option < T > { let mut slot = None ; self . iterate_assoc_items_dyn ( db , krate , & mut | assoc_item_id | { slot = callback ( assoc_item_id . into ( ) ) ; slot . is_some ( ) } ) ; slot }
This would be nicer if it just returned an iterator, but that runs into
lifetime problems, because we need to borrow temp `CrateImplDefs`.
This would be nicer if it just returned an iterator but that runs into lifetime problems because we need to borrow temp ` CrateImplDefs ` .
&self
db
&dyn HirDatabase
krate
Crate
callback
impl FnMut(AssocItem) -> Option<T>
&self
db
&dyn HirDatabase
krate
Crate
callback
impl FnMut(AssocItem) -> Option<T>