/// Partitions this `PackageSet` into two.
///
/// The first `PackageSet` contains packages for which the callback returned true, and the
/// second one contains packages for which the callback returned false.
///
/// ## Cycles
///
/// For packages within a dependency cycle, the callback will be called in non-dev order. When
/// the direction is forward, if package Foo has a dependency on Bar, and Bar has a cyclic
/// dev-dependency on Foo, then Foo is returned before Bar.
Partitions this `PackageSet` into two.
The first `PackageSet` contains packages for which the callback returned true, and the
second one contains packages for which the callback returned false.
Partitions this ` PackageSet ` into two . The first ` PackageSet ` contains packages for which the callback returned true and the second one contains packages for which the callback returned false .
pub fn partition(
        &self,
        direction: DependencyDirection,
        mut callback: impl FnMut(PackageMetadata<'g>) -> bool,
    ) -> (Self, Self) {
        let graph = self.graph;
        let mut left = IxBitSet::with_capacity(self.core.included.len());
        let mut right = left.clone();
        self.packages(direction).for_each(|package| {
            let package_ix = package.package_ix();
            match callback(package) {
                true => left.insert_node_ix(package_ix),
                false => right.insert_node_ix(package_ix),
            }
        });
        (
            Self::from_included(*graph, left),
            Self::from_included(*graph, right),
        )
    }
pub fn partition ( & self , direction : DependencyDirection , mut callback : impl FnMut ( PackageMetadata < ' g > ) -> bool , ) -> ( Self , Self ) { let graph = self . graph ; let mut left = IxBitSet :: with_capacity ( self . core . included . len ( ) ) ; let mut right = left . clone ( ) ; self . packages ( direction ) . for_each ( | package | { let package_ix = package . package_ix ( ) ; match callback ( package ) { true => left . insert_node_ix ( package_ix ) , false => right . insert_node_ix ( package_ix ) , } } ) ; ( Self :: from_included ( * graph , left ) , Self :: from_included ( * graph , right ) , ) }
Partitions this `PackageSet` into two.
Partitions this ` PackageSet ` into two .
&self
direction
DependencyDirection
callback
impl FnMut(PackageMetadata<'g>) -> bool
cycles
For packages within a dependency cycle, the callback will be called in non-dev order. When
the direction is forward, if package Foo has a dependency on Bar, and Bar has a cyclic
dev-dependency on Foo, then Foo is returned before Bar.
For packages within a dependency cycle the callback will be called in non - dev order . When the direction is forward if package Foo has a dependency on Bar and Bar has a cyclic dev - dependency on Foo then Foo is returned before Bar .