cargo::ops::cargo_add

Function get_existing_dependency

source
fn get_existing_dependency(
    ws: &Workspace<'_>,
    unstable_features: &Features,
    manifest: &LocalManifest,
    dep_key: &str,
    section: &DepTable,
) -> CargoResult<Option<Dependency>>
Expand description

Provide the existing dependency for the target table

If it doesn’t exist but exists in another table, let’s use that as most likely users want to use the same version across all tables unless they are renaming.