pub fn pop_children_of<T: PartialEq>(
        parents: &mut SparseSecondaryMap<DeviceEntity, T>,
        parent: T,
    ) -> impl Iterator<Item = DeviceEntity> + '_ {
        let taker = std::iter::repeat_with(move || {
            match parents.iter().find(|(_, cparent)| **cparent == parent) {
                Some((child, _)) => {
                    parents.remove(child);
                    Some(child)
                }
                None => None,
            }
        });

        taker.take_while(Option::is_some).map(Option::unwrap)
    }
/// Removes all entity keys which are associated with a given parent entity.
Removes all entity keys which are associated with a given parent entity.
Removes all entity keys which are associated with a given parent entity .
pub fn pop_children_of<T: PartialEq>(
        parents: &mut SparseSecondaryMap<DeviceEntity, T>,
        parent: T,
    ) -> impl Iterator<Item = DeviceEntity> + '_ {
        let taker = std::iter::repeat_with(move || {
            match parents.iter().find(|(_, cparent)| **cparent == parent) {
                Some((child, _)) => {
                    parents.remove(child);
                    Some(child)
                }
                None => None,
            }
        });
        taker.take_while(Option::is_some).map(Option::unwrap)
    }
pub fn pop_children_of < T : PartialEq > ( parents : & mut SparseSecondaryMap < DeviceEntity , T > , parent : T , ) -> impl Iterator < Item = DeviceEntity > + ' _ { let taker = std :: iter :: repeat_with ( move | | { match parents . iter ( ) . find ( | ( _ , cparent ) | * * cparent == parent ) { Some ( ( child , _ ) ) => { parents . remove ( child ) ; Some ( child ) } None => None , } } ) ; taker . take_while ( Option :: is_some ) . map ( Option :: unwrap ) }
Removes all entity keys which are associated with a given parent entity.
Removes all entity keys which are associated with a given parent entity .
parents
&mut SparseSecondaryMap<DeviceEntity, T>
parent
T
parents
&mut SparseSecondaryMap<DeviceEntity, T>
parent
T