From b12e027d93a84547cc9674aa584130a502225702 Mon Sep 17 00:00:00 2001 From: SRetip Date: Fri, 22 Mar 2024 15:34:48 +0200 Subject: [PATCH 1/3] add fasade --- module/move/willbe/Cargo.toml | 1 + module/move/willbe/src/action/list.rs | 37 ++++---- .../src/action/readme_health_table_renew.rs | 11 +-- module/move/willbe/src/entity/package.rs | 8 +- module/move/willbe/src/entity/packages.rs | 4 +- module/move/willbe/src/entity/workspace.rs | 86 +++++++++++++++++-- .../move/willbe/tests/inc/entity/features.rs | 3 +- 7 files changed, 107 insertions(+), 43 deletions(-) diff --git a/module/move/willbe/Cargo.toml b/module/move/willbe/Cargo.toml index 634aa69258..db4b1be188 100644 --- a/module/move/willbe/Cargo.toml +++ b/module/move/willbe/Cargo.toml @@ -55,6 +55,7 @@ tracing-subscriber = { version = "0.3", optional = true } indicatif = { version = "0.17", optional = true } prettytable-rs = "0.10" serde_json = "1.0" # for CargoMetadata::Package::metadata (need serde_json::Value) +serde = "1.0" # for CargoMetadata::Package ## internal crates_tools = { workspace = true } diff --git a/module/move/willbe/src/action/list.rs b/module/move/willbe/src/action/list.rs index 2961a3d62d..22cdd3f3f5 100644 --- a/module/move/willbe/src/action/list.rs +++ b/module/move/willbe/src/action/list.rs @@ -24,17 +24,14 @@ mod private }; // aaa : for Petro : don't use cargo_metadata and Package directly, use facade // aaa : ✅ - use cargo_metadata:: - { - Dependency, - DependencyKind, - }; + use petgraph::prelude::{ Dfs, EdgeRef }; use former::Former; use workspace::Workspace; use _path::AbsolutePath; use workspace::WorkspacePackage; + use crate::workspace::{Dependency, DependencyKind}; /// Args for `list` action. #[ derive( Debug, Default, Copy, Clone ) ] @@ -312,16 +309,16 @@ mod private visited : &mut HashSet< String > ) { - for dependency in package.dependencies() + for dependency in &package.dependencies() { - if dependency.path.is_some() && !args.dependency_sources.contains( &DependencySource::Local ) { continue; } - if dependency.path.is_none() && !args.dependency_sources.contains( &DependencySource::Remote ) { continue; } - let dep_id = format!( "{}+{}+{}", dependency.name, dependency.req, dependency.path.as_ref().map( | p | p.join( "Cargo.toml" ) ).unwrap_or_default() ); + if dependency.path().is_some() && !args.dependency_sources.contains( &DependencySource::Local ) { continue; } + if dependency.path().is_none() && !args.dependency_sources.contains( &DependencySource::Remote ) { continue; } + let dep_id = format!( "{}+{}+{}", dependency.name(), dependency.req(), dependency.path().as_ref().map( | p | p.join( "Cargo.toml" ) ).unwrap_or_default() ); let mut temp_vis = visited.clone(); let dependency_rep = process_dependency( workspace, dependency, args, &mut temp_vis ); - match dependency.kind + match dependency.kind() { DependencyKind::Normal if args.dependency_categories.contains( &DependencyCategory::Primary ) => dep_rep.normal_dependencies.push( dependency_rep ), DependencyKind::Development if args.dependency_categories.contains( &DependencyCategory::Dev ) => dep_rep.dev_dependencies.push( dependency_rep ), @@ -337,15 +334,15 @@ mod private { let mut dep_rep = ListNodeReport { - name : dep.name.clone(), - version : if args.info.contains( &PackageAdditionalInfo::Version ) { Some( dep.req.to_string() ) } else { None }, - path : if args.info.contains( &PackageAdditionalInfo::Path ) { dep.path.as_ref().map( | p | p.clone().into_std_path_buf() ) } else { None }, + name : dep.name().clone(), + version : if args.info.contains( &PackageAdditionalInfo::Version ) { Some( dep.req().to_string() ) } else { None }, + path : if args.info.contains( &PackageAdditionalInfo::Path ) { dep.path().as_ref().map( | p | p.clone().into_std_path_buf() ) } else { None }, normal_dependencies : vec![], dev_dependencies : vec![], build_dependencies : vec![], }; - let dep_id = format!( "{}+{}+{}", dep.name, dep.req, dep.path.as_ref().map( | p | p.join( "Cargo.toml" ) ).unwrap_or_default() ); + let dep_id = format!( "{}+{}+{}", dep.name(), dep.req(), dep.path().as_ref().map( | p | p.join( "Cargo.toml" ) ).unwrap_or_default() ); // if this is a cycle (we have visited this node before) if visited.contains( &dep_id ) { @@ -356,7 +353,7 @@ mod private // if we have not visited this node before, mark it as visited visited.insert( dep_id ); - if let Some( path ) = &dep.path + if let Some( path ) = &dep.path() { if let Some( package ) = workspace.package_find_by_manifest( path.as_std_path().join( "Cargo.toml" ) ) { @@ -450,14 +447,14 @@ mod private let dep_filter = move | _p : &WorkspacePackage, d : &Dependency | { ( - args.dependency_categories.contains( &DependencyCategory::Primary ) && d.kind == DependencyKind::Normal - || args.dependency_categories.contains( &DependencyCategory::Dev ) && d.kind == DependencyKind::Development - || args.dependency_categories.contains( &DependencyCategory::Build ) && d.kind == DependencyKind::Build + args.dependency_categories.contains( &DependencyCategory::Primary ) && d.kind() == DependencyKind::Normal + || args.dependency_categories.contains( &DependencyCategory::Dev ) && d.kind() == DependencyKind::Development + || args.dependency_categories.contains( &DependencyCategory::Build ) && d.kind() == DependencyKind::Build ) && ( - args.dependency_sources.contains( &DependencySource::Remote ) && d.path.is_none() - || args.dependency_sources.contains( &DependencySource::Local ) && d.path.is_some() + args.dependency_sources.contains( &DependencySource::Remote ) && d.path().is_none() + || args.dependency_sources.contains( &DependencySource::Local ) && d.path().is_some() ) }; diff --git a/module/move/willbe/src/action/readme_health_table_renew.rs b/module/move/willbe/src/action/readme_health_table_renew.rs index 5c28081b75..36f897dc2d 100644 --- a/module/move/willbe/src/action/readme_health_table_renew.rs +++ b/module/move/willbe/src/action/readme_health_table_renew.rs @@ -10,11 +10,7 @@ mod private io::{ Write, Read, Seek, SeekFrom }, collections::HashMap, }; - use cargo_metadata:: - { - Dependency, - DependencyKind, - }; + // aaa : for Petro : don't use cargo_metadata and Package directly, use facade // aaa : ✅ @@ -39,6 +35,7 @@ mod private use workspace::Workspace; use _path::AbsolutePath; use workspace::WorkspacePackage; + use crate::workspace::{Dependency, DependencyKind}; static TAG_TEMPLATE: std::sync::OnceLock< Regex > = std::sync::OnceLock::new(); static CLOSE_TAG: std::sync::OnceLock< Regex > = std::sync::OnceLock::new(); @@ -339,12 +336,12 @@ mod private p.publish().is_none() && p.manifest_path().starts_with( &path ) ) ); - let module_dependency_filter: Option< Box< dyn Fn( &WorkspacePackage, &Dependency) -> bool > > = Some + let module_dependency_filter: Option< Box< dyn Fn( &WorkspacePackage, &Dependency ) -> bool > > = Some ( Box::new ( move | _, d | - d.path.is_some() && d.kind != DependencyKind::Development && d.path.as_ref().unwrap().starts_with( &path_clone ) + d.path().is_some() && d.kind() != DependencyKind::Development && d.path().as_ref().unwrap().starts_with( &path_clone ) ) ); let module_packages_map = packages::filter diff --git a/module/move/willbe/src/entity/package.rs b/module/move/willbe/src/entity/package.rs index f64dfcb800..d2f4bf543b 100644 --- a/module/move/willbe/src/entity/package.rs +++ b/module/move/willbe/src/entity/package.rs @@ -10,7 +10,6 @@ mod private use std::fmt::Formatter; use std::hash::Hash; use std::path::PathBuf; - use cargo_metadata::{ Dependency, DependencyKind }; use process_tools::process; use manifest::{ Manifest, ManifestError }; @@ -33,6 +32,7 @@ mod private use action::readme_health_table_renew::Stability; use former::Former; use workspace::WorkspacePackage; + use crate::workspace::{Dependency, DependencyKind}; /// #[ derive( Debug, Clone ) ] @@ -769,8 +769,8 @@ mod private { Self { - name : value.name.clone(), - path : value.path.clone().map( | path | AbsolutePath::try_from( path ).unwrap() ), + name : value.name().clone(), + path : value.path().clone().map( | path | AbsolutePath::try_from( path ).unwrap() ), } } } @@ -803,7 +803,7 @@ mod private let deps = package .dependencies() .iter() - .filter( | dep | ( with_remote || dep.path.is_some() ) && ( with_dev || dep.kind != DependencyKind::Development ) ) + .filter( | dep | ( with_remote || dep.path().is_some() ) && ( with_dev || dep.kind() != DependencyKind::Development ) ) .map( CrateId::from ) .collect::< HashSet< _ > >(); diff --git a/module/move/willbe/src/entity/packages.rs b/module/move/willbe/src/entity/packages.rs index 671770d40b..5f48b09b3f 100644 --- a/module/move/willbe/src/entity/packages.rs +++ b/module/move/willbe/src/entity/packages.rs @@ -6,8 +6,8 @@ mod private fmt::Formatter, collections::{ HashMap, HashSet }, }; - use cargo_metadata::{ Dependency }; use workspace::WorkspacePackage; + use crate::workspace::Dependency; /// Type aliasing for String pub type PackageName = String; @@ -89,7 +89,7 @@ mod private package.dependencies() .iter() .filter( | &d | dependency_filter( package, d ) ) - .map( | d | d.name.clone() ) + .map( | d | d.name().clone() ) .collect::< HashSet< _ > >() ) ) diff --git a/module/move/willbe/src/entity/workspace.rs b/module/move/willbe/src/entity/workspace.rs index 816ecc1d24..d587cb68c4 100644 --- a/module/move/willbe/src/entity/workspace.rs +++ b/module/move/willbe/src/entity/workspace.rs @@ -4,18 +4,20 @@ mod private use crate::*; use std::path::Path; - use cargo_metadata::{ Dependency, Metadata, MetadataCommand, Package }; - use cargo_metadata::camino::Utf8Path; + use cargo_metadata::{ Dependency as CMDependency, DependencyKind as CMDependencyKind, Metadata, MetadataCommand, Package }; + use cargo_metadata::camino::{Utf8Path, Utf8PathBuf}; use petgraph::Graph; - use semver::Version; + use semver::{Version, VersionReq}; + use serde::Deserialize; use serde_json::Value; use wtools::error::{ for_app::Context, for_lib::Error, Result }; use _path::AbsolutePath; /// Facade for cargo_metadata::Package - #[ derive( Debug, Clone ) ] + #[ derive( Debug, Clone, Deserialize ) ] pub struct WorkspacePackage { + #[ serde( flatten ) ] inner : Package } @@ -39,9 +41,9 @@ mod private } /// List of dependencies of this particular package - pub fn dependencies( &self ) -> &[ Dependency ] + pub fn dependencies( &self ) -> Vec< Dependency > { - self.inner.dependencies.as_slice() + self.inner.dependencies.iter().cloned().map( Dependency::from ).collect() } /// Path containing the Cargo.toml @@ -106,6 +108,72 @@ mod private } + /// A dependency of the main crate + #[ derive( Debug ) ] + pub struct Dependency + { + inner : CMDependency, + } + + impl Dependency + { + /// The file system path for a local path dependency. + /// Only produced on cargo 1.51+ + pub fn path( &self ) -> Option< Utf8PathBuf > + { + self.inner.path.clone() + } + + /// Name as given in the Cargo.toml. + pub fn name( &self ) -> String + { + self.inner.name.clone() + } + + /// The kind of dependency this is. + pub fn kind( &self ) -> DependencyKind + { + match self.inner.kind + { + CMDependencyKind::Normal => DependencyKind::Normal, + CMDependencyKind::Development => DependencyKind::Development, + CMDependencyKind::Build => DependencyKind::Build, + CMDependencyKind::Unknown => DependencyKind::Unknown, + } + } + + /// he required version + pub fn req( &self ) -> VersionReq + { + self.inner.req.clone() + } + } + + impl From< CMDependency > for Dependency + { + fn from( inner : CMDependency ) -> Self + { + Self + { + inner + } + } + } + + /// Dependencies can come in three kinds + #[ derive( Eq, PartialEq, Debug ) ] + pub enum DependencyKind + { + /// The 'normal' kind + Normal, + /// Those used in tests only + Development, + /// Those used in build scripts only + Build, + /// The 'unknown' kind + Unknown, + } + /// Stores information about current workspace. #[ derive( Debug, Clone ) ] pub struct Workspace @@ -267,11 +335,11 @@ mod private ( Box::new( move | p | p.publish().is_none() ) ); - let module_dependency_filter : Option< Box< dyn Fn( &WorkspacePackage, &cargo_metadata::Dependency) -> bool > > = Some + let module_dependency_filter : Option< Box< dyn Fn( &WorkspacePackage, &Dependency ) -> bool > > = Some ( Box::new ( - move | _, d | d.path.is_some() && d.kind != cargo_metadata::DependencyKind::Development + move | _, d | d.path().is_some() && d.kind() != DependencyKind::Development ) ); let module_packages_map = packages::filter @@ -292,4 +360,6 @@ crate::mod_interface! exposed use Workspace; orphan use WorkspaceError; protected use WorkspacePackage; + protected use Dependency; + protected use DependencyKind; } diff --git a/module/move/willbe/tests/inc/entity/features.rs b/module/move/willbe/tests/inc/entity/features.rs index 555f2b608a..3ee575389a 100644 --- a/module/move/willbe/tests/inc/entity/features.rs +++ b/module/move/willbe/tests/inc/entity/features.rs @@ -4,7 +4,6 @@ use super::*; use the_module::features::features_powerset; use std::collections::HashMap; -use cargo_metadata::Package; use serde::Deserialize; use the_module::workspace::WorkspacePackage; @@ -34,7 +33,7 @@ fn mock_package( features : Vec< ( &str, Vec< &str > ) > ) -> WorkspacePackage } ); - Package::deserialize( json ).unwrap().into() + WorkspacePackage::deserialize( json ).unwrap() } #[ test ] From 60117fe0e1e83d3eff84148463edda7a5aa902a6 Mon Sep 17 00:00:00 2001 From: SRetip Date: Fri, 22 Mar 2024 16:01:00 +0200 Subject: [PATCH 2/3] fix use --- module/move/willbe/src/action/list.rs | 17 ++++---- module/move/willbe/src/entity/package.rs | 7 ++-- module/move/willbe/src/entity/workspace.rs | 45 ++++++++++++---------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/module/move/willbe/src/action/list.rs b/module/move/willbe/src/action/list.rs index 22cdd3f3f5..b8b25c9369 100644 --- a/module/move/willbe/src/action/list.rs +++ b/module/move/willbe/src/action/list.rs @@ -31,7 +31,6 @@ mod private use workspace::Workspace; use _path::AbsolutePath; use workspace::WorkspacePackage; - use crate::workspace::{Dependency, DependencyKind}; /// Args for `list` action. #[ derive( Debug, Default, Copy, Clone ) ] @@ -320,9 +319,9 @@ mod private match dependency.kind() { - DependencyKind::Normal if args.dependency_categories.contains( &DependencyCategory::Primary ) => dep_rep.normal_dependencies.push( dependency_rep ), - DependencyKind::Development if args.dependency_categories.contains( &DependencyCategory::Dev ) => dep_rep.dev_dependencies.push( dependency_rep ), - DependencyKind::Build if args.dependency_categories.contains( &DependencyCategory::Build ) => dep_rep.build_dependencies.push( dependency_rep ), + workspace::DependencyKind::Normal if args.dependency_categories.contains( &DependencyCategory::Primary ) => dep_rep.normal_dependencies.push( dependency_rep ), + workspace::DependencyKind::Development if args.dependency_categories.contains( &DependencyCategory::Dev ) => dep_rep.dev_dependencies.push( dependency_rep ), + workspace::DependencyKind::Build if args.dependency_categories.contains( &DependencyCategory::Build ) => dep_rep.build_dependencies.push( dependency_rep ), _ => { visited.remove( &dep_id ); std::mem::swap( &mut temp_vis, visited ); } } @@ -330,7 +329,7 @@ mod private } } - fn process_dependency( workspace : &Workspace, dep : &Dependency, args : &ListOptions, visited : &mut HashSet< String > ) -> ListNodeReport + fn process_dependency( workspace : &Workspace, dep : &workspace::Dependency, args : &ListOptions, visited : &mut HashSet< String > ) -> ListNodeReport { let mut dep_rep = ListNodeReport { @@ -444,12 +443,12 @@ mod private .map( | m | m[ "name" ].to_string().trim().replace( '\"', "" ) ) .unwrap_or_default(); - let dep_filter = move | _p : &WorkspacePackage, d : &Dependency | + let dep_filter = move | _p : &WorkspacePackage, d : &workspace::Dependency | { ( - args.dependency_categories.contains( &DependencyCategory::Primary ) && d.kind() == DependencyKind::Normal - || args.dependency_categories.contains( &DependencyCategory::Dev ) && d.kind() == DependencyKind::Development - || args.dependency_categories.contains( &DependencyCategory::Build ) && d.kind() == DependencyKind::Build + args.dependency_categories.contains( &DependencyCategory::Primary ) && d.kind() == workspace::DependencyKind::Normal + || args.dependency_categories.contains( &DependencyCategory::Dev ) && d.kind() == workspace::DependencyKind::Development + || args.dependency_categories.contains( &DependencyCategory::Build ) && d.kind() == workspace::DependencyKind::Build ) && ( diff --git a/module/move/willbe/src/entity/package.rs b/module/move/willbe/src/entity/package.rs index d2f4bf543b..beacf5e2fd 100644 --- a/module/move/willbe/src/entity/package.rs +++ b/module/move/willbe/src/entity/package.rs @@ -32,7 +32,6 @@ mod private use action::readme_health_table_renew::Stability; use former::Former; use workspace::WorkspacePackage; - use crate::workspace::{Dependency, DependencyKind}; /// #[ derive( Debug, Clone ) ] @@ -763,9 +762,9 @@ mod private } } - impl From< &Dependency > for CrateId + impl From< &workspace::Dependency > for CrateId { - fn from( value : &Dependency ) -> Self + fn from( value : &workspace::Dependency ) -> Self { Self { @@ -803,7 +802,7 @@ mod private let deps = package .dependencies() .iter() - .filter( | dep | ( with_remote || dep.path().is_some() ) && ( with_dev || dep.kind() != DependencyKind::Development ) ) + .filter( | dep | ( with_remote || dep.path().is_some() ) && ( with_dev || dep.kind() != workspace::DependencyKind::Development ) ) .map( CrateId::from ) .collect::< HashSet< _ > >(); diff --git a/module/move/willbe/src/entity/workspace.rs b/module/move/willbe/src/entity/workspace.rs index d587cb68c4..26a586e6d9 100644 --- a/module/move/willbe/src/entity/workspace.rs +++ b/module/move/willbe/src/entity/workspace.rs @@ -4,13 +4,16 @@ mod private use crate::*; use std::path::Path; - use cargo_metadata::{ Dependency as CMDependency, DependencyKind as CMDependencyKind, Metadata, MetadataCommand, Package }; - use cargo_metadata::camino::{Utf8Path, Utf8PathBuf}; + use cargo_metadata::camino::{ Utf8Path, Utf8PathBuf }; use petgraph::Graph; - use semver::{Version, VersionReq}; use serde::Deserialize; use serde_json::Value; - use wtools::error::{ for_app::Context, for_lib::Error, Result }; + use wtools::error:: + { + for_app::Context, + for_lib::Error, + Result + }; use _path::AbsolutePath; /// Facade for cargo_metadata::Package @@ -18,12 +21,12 @@ mod private pub struct WorkspacePackage { #[ serde( flatten ) ] - inner : Package + inner : cargo_metadata::Package } - impl From< Package > for WorkspacePackage + impl From< cargo_metadata::Package > for WorkspacePackage { - fn from( inner : Package) -> Self + fn from( inner : cargo_metadata::Package) -> Self { Self { @@ -53,7 +56,7 @@ mod private } /// The version field as specified in the Cargo.toml - pub fn version( &self ) -> Version + pub fn version( &self ) -> semver::Version { self.inner.version.clone() } @@ -112,7 +115,7 @@ mod private #[ derive( Debug ) ] pub struct Dependency { - inner : CMDependency, + inner : cargo_metadata::Dependency, } impl Dependency @@ -135,23 +138,23 @@ mod private { match self.inner.kind { - CMDependencyKind::Normal => DependencyKind::Normal, - CMDependencyKind::Development => DependencyKind::Development, - CMDependencyKind::Build => DependencyKind::Build, - CMDependencyKind::Unknown => DependencyKind::Unknown, + cargo_metadata::DependencyKind::Normal => DependencyKind::Normal, + cargo_metadata::DependencyKind::Development => DependencyKind::Development, + cargo_metadata::DependencyKind::Build => DependencyKind::Build, + cargo_metadata::DependencyKind::Unknown => DependencyKind::Unknown, } } /// he required version - pub fn req( &self ) -> VersionReq + pub fn req( &self ) -> semver::VersionReq { self.inner.req.clone() } } - impl From< CMDependency > for Dependency + impl From< cargo_metadata::Dependency > for Dependency { - fn from( inner : CMDependency ) -> Self + fn from( inner : cargo_metadata::Dependency ) -> Self { Self { @@ -178,7 +181,7 @@ mod private #[ derive( Debug, Clone ) ] pub struct Workspace { - metadata : Option< Metadata >, + metadata : Option< cargo_metadata::Metadata >, manifest_dir : CrateDir, } @@ -197,7 +200,7 @@ mod private pub fn from_current_path() -> Result< Self > { let current_path = AbsolutePath::try_from( std::env::current_dir().unwrap_or_default() )?; - let metadata = MetadataCommand::new().no_deps().exec().context("fail to load CargoMetadata")?; + let metadata = cargo_metadata::MetadataCommand::new().no_deps().exec().context("fail to load CargoMetadata")?; Ok( Self { metadata : Some( metadata ), @@ -212,16 +215,16 @@ mod private ( Self { - metadata : Some( MetadataCommand::new().current_dir( crate_dir.as_ref() ).no_deps().exec().context( "fail to load CargoMetadata" )? ), + metadata : Some( cargo_metadata::MetadataCommand::new().current_dir( crate_dir.as_ref() ).no_deps().exec().context( "fail to load CargoMetadata" )? ), manifest_dir : crate_dir, } ) } } - impl From< Metadata > for Workspace + impl From< cargo_metadata::Metadata > for Workspace { - fn from( value : Metadata ) -> Self + fn from( value : cargo_metadata::Metadata ) -> Self { let path = value.workspace_root.as_std_path().parent().unwrap().to_path_buf(); let path = AbsolutePath::try_from( path ).unwrap(); From ab67573794dabe709703e0de2b221f541b925718 Mon Sep 17 00:00:00 2001 From: SRetip Date: Fri, 22 Mar 2024 16:05:09 +0200 Subject: [PATCH 3/3] fix uses2 --- .../willbe/src/action/readme_health_table_renew.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/module/move/willbe/src/action/readme_health_table_renew.rs b/module/move/willbe/src/action/readme_health_table_renew.rs index 36f897dc2d..6ae14f0094 100644 --- a/module/move/willbe/src/action/readme_health_table_renew.rs +++ b/module/move/willbe/src/action/readme_health_table_renew.rs @@ -32,10 +32,7 @@ mod private } }; use manifest::private::repo_url; - use workspace::Workspace; use _path::AbsolutePath; - use workspace::WorkspacePackage; - use crate::workspace::{Dependency, DependencyKind}; static TAG_TEMPLATE: std::sync::OnceLock< Regex > = std::sync::OnceLock::new(); static CLOSE_TAG: std::sync::OnceLock< Regex > = std::sync::OnceLock::new(); @@ -325,10 +322,10 @@ mod private } /// Return topologically sorted modules name, from packages list, in specified directory. - fn directory_names( path : PathBuf, packages : &[ WorkspacePackage ] ) -> Result< Vec< String > > + fn directory_names( path : PathBuf, packages : &[ workspace::WorkspacePackage ] ) -> Result< Vec< String > > { let path_clone = path.clone(); - let module_package_filter: Option< Box< dyn Fn( &WorkspacePackage ) -> bool > > = Some + let module_package_filter: Option< Box< dyn Fn( &workspace::WorkspacePackage ) -> bool > > = Some ( Box::new ( @@ -336,12 +333,12 @@ mod private p.publish().is_none() && p.manifest_path().starts_with( &path ) ) ); - let module_dependency_filter: Option< Box< dyn Fn( &WorkspacePackage, &Dependency ) -> bool > > = Some + let module_dependency_filter: Option< Box< dyn Fn( &workspace::WorkspacePackage, &workspace::Dependency ) -> bool > > = Some ( Box::new ( move | _, d | - d.path().is_some() && d.kind() != DependencyKind::Development && d.path().as_ref().unwrap().starts_with( &path_clone ) + d.path().is_some() && d.kind() != workspace::DependencyKind::Development && d.path().as_ref().unwrap().starts_with( &path_clone ) ) ); let module_packages_map = packages::filter