mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +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,9 +1694,8 @@ fn inner_dependency_inherit_with<'a>(
|
||||
})
|
||||
}
|
||||
|
||||
impl<P: ResolveToPath + Clone> schema::TomlDependency<P> {
|
||||
pub(crate) fn to_dependency_split(
|
||||
&self,
|
||||
pub(crate) fn to_dependency<P: ResolveToPath + Clone>(
|
||||
dep: &schema::TomlDependency<P>,
|
||||
name: &str,
|
||||
source_id: SourceId,
|
||||
nested_paths: &mut Vec<PathBuf>,
|
||||
@ -1706,9 +1705,9 @@ impl<P: ResolveToPath + Clone> schema::TomlDependency<P> {
|
||||
root: &Path,
|
||||
features: &Features,
|
||||
kind: Option<DepKind>,
|
||||
) -> CargoResult<Dependency> {
|
||||
) -> CargoResult<Dependency> {
|
||||
dep_to_dependency(
|
||||
self,
|
||||
dep,
|
||||
name,
|
||||
&mut Context {
|
||||
deps: &mut Vec::new(),
|
||||
@ -1722,7 +1721,6 @@ impl<P: ResolveToPath + Clone> schema::TomlDependency<P> {
|
||||
},
|
||||
kind,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fn dep_to_dependency<P: ResolveToPath + Clone>(
|
||||
|
Loading…
x
Reference in New Issue
Block a user