/// Returns the set of operations that need to be performed to add the workspace-hack
/// dependency to the given set of workspace crates.
///
/// Also includes remove operations for the workspace-hack dependency from excluded crates.
///
/// Returns `None` if the hakari package wasn't specified at construction time.
///
/// Requires the `cli-support` feature to be enabled.
Returns the set of operations that need to be performed to add the workspace-hack
dependency to the given set of workspace crates.

Also includes remove operations for the workspace-hack dependency from excluded crates.

Returns `None` if the hakari package wasn't specified at construction time.

Requires the `cli-support` feature to be enabled.
Returns the set of operations that need to be performed to add the workspace - hack dependency to the given set of workspace crates . Also includes remove operations for the workspace - hack dependency from excluded crates . Returns ` None ` if the hakari package wasn ' t specified at construction time . Requires the ` cli - support ` feature to be enabled .
pub fn manage_dep_ops(&self, workspace_set: &PackageSet<'g>) -> Option<WorkspaceOps<'g, '_>> {
        let graph = self.graph();
        let hakari_package = self.hakari_package()?;
        let (add_to, remove_from) =
            workspace_set.filter_partition(DependencyDirection::Reverse, |package| {
                let link_opt = package
                    .link_to(hakari_package.id())
                    .expect("valid package ID");
                let should_be_included = !self.is_excluded(package.id()).expect("valid package ID");
                match (link_opt, should_be_included) {
                    (None, true) => Some(true),
                    (Some(_), false) => Some(false),
                    (Some(link), true) => match self.dep_format_version {
                        DepFormatVersion::V1 => None,
                        DepFormatVersion::V2 => needs_update_v2(hakari_package, link).then(|| true),
                    },
                    (None, false) => None,
                }
            });
        let mut ops = Vec::with_capacity(2);
        if !add_to.is_empty() {
            ops.push(WorkspaceOp::AddDependency {
                name: hakari_package.name(),
                crate_path: hakari_package
                    .source()
                    .workspace_path()
                    .expect("hakari package is in workspace"),
                version: hakari_package.version(),
                dep_format: self.dep_format_version,
                add_to,
            });
        }
        if !remove_from.is_empty() {
            ops.push(WorkspaceOp::RemoveDependency {
                name: hakari_package.name(),
                remove_from,
            });
        }
        Some(WorkspaceOps::new(graph, ops))
    }
pub fn manage_dep_ops ( & self , workspace_set : & PackageSet < ' g > ) -> Option < WorkspaceOps < ' g , ' _ > > { let graph = self . graph ( ) ; let hakari_package = self . hakari_package ( ) ? ; let ( add_to , remove_from ) = workspace_set . filter_partition ( DependencyDirection :: Reverse , | package | { let link_opt = package . link_to ( hakari_package . id ( ) ) . expect ( " " ) ; let should_be_included = ! self . is_excluded ( package . id ( ) ) . expect ( " " ) ; match ( link_opt , should_be_included ) { ( None , true ) => Some ( true ) , ( Some ( _ ) , false ) => Some ( false ) , ( Some ( link ) , true ) => match self . dep_format_version { DepFormatVersion :: V1 => None , DepFormatVersion :: V2 => needs_update_v2 ( hakari_package , link ) . then ( | | true ) , } , ( None , false ) => None , } } ) ; let mut ops = Vec :: with_capacity ( 2 ) ; if ! add_to . is_empty ( ) { ops . push ( WorkspaceOp :: AddDependency { name : hakari_package . name ( ) , crate_path : hakari_package . source ( ) . workspace_path ( ) . expect ( " " ) , version : hakari_package . version ( ) , dep_format : self . dep_format_version , add_to , } ) ; } if ! remove_from . is_empty ( ) { ops . push ( WorkspaceOp :: RemoveDependency { name : hakari_package . name ( ) , remove_from , } ) ; } Some ( WorkspaceOps :: new ( graph , ops ) ) }
Returns the set of operations that need to be performed to add the workspace-hack
dependency to the given set of workspace crates.
Returns the set of operations that need to be performed to add the workspace - hack dependency to the given set of workspace crates .
&self
workspace_set
&PackageSet<'g>