mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
refactor(toml): Make Dep's to_dependency_split a free function
This commit is contained in:
parent
8ff20c7b3c
commit
89f8f5c77a
@ -437,7 +437,8 @@ impl<'cfg> Workspace<'cfg> {
|
||||
url,
|
||||
deps.iter()
|
||||
.map(|(name, dep)| {
|
||||
dep.to_dependency_split(
|
||||
crate::util::toml::to_dependency(
|
||||
dep,
|
||||
name,
|
||||
source,
|
||||
&mut nested_paths,
|
||||
|
@ -1694,35 +1694,33 @@ fn inner_dependency_inherit_with<'a>(
|
||||
})
|
||||
}
|
||||
|
||||
impl<P: ResolveToPath + Clone> schema::TomlDependency<P> {
|
||||
pub(crate) fn to_dependency_split(
|
||||
&self,
|
||||
name: &str,
|
||||
source_id: SourceId,
|
||||
nested_paths: &mut Vec<PathBuf>,
|
||||
config: &Config,
|
||||
warnings: &mut Vec<String>,
|
||||
platform: Option<Platform>,
|
||||
root: &Path,
|
||||
features: &Features,
|
||||
kind: Option<DepKind>,
|
||||
) -> CargoResult<Dependency> {
|
||||
dep_to_dependency(
|
||||
self,
|
||||
name,
|
||||
&mut Context {
|
||||
deps: &mut Vec::new(),
|
||||
source_id,
|
||||
nested_paths,
|
||||
config,
|
||||
warnings,
|
||||
platform,
|
||||
root,
|
||||
features,
|
||||
},
|
||||
kind,
|
||||
)
|
||||
}
|
||||
pub(crate) fn to_dependency<P: ResolveToPath + Clone>(
|
||||
dep: &schema::TomlDependency<P>,
|
||||
name: &str,
|
||||
source_id: SourceId,
|
||||
nested_paths: &mut Vec<PathBuf>,
|
||||
config: &Config,
|
||||
warnings: &mut Vec<String>,
|
||||
platform: Option<Platform>,
|
||||
root: &Path,
|
||||
features: &Features,
|
||||
kind: Option<DepKind>,
|
||||
) -> CargoResult<Dependency> {
|
||||
dep_to_dependency(
|
||||
dep,
|
||||
name,
|
||||
&mut Context {
|
||||
deps: &mut Vec::new(),
|
||||
source_id,
|
||||
nested_paths,
|
||||
config,
|
||||
warnings,
|
||||
platform,
|
||||
root,
|
||||
features,
|
||||
},
|
||||
kind,
|
||||
)
|
||||
}
|
||||
|
||||
fn dep_to_dependency<P: ResolveToPath + Clone>(
|
||||
|
Loading…
x
Reference in New Issue
Block a user