-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Labels
Description
Hi there,
Context :
We take the lazy_static
crate for the sake of the example.
When you use cargo add
command to add the dependency but specify it with a dash instead of an underscore, you end up with this message WARN: Added 'lazy_static' instead of 'lazy-static'
.
Lines 74 to 78 in bd49ee2
let dep = read_latest_version(&crate_versions, flag_allow_prerelease)?; | |
if dep.name != crate_name { | |
eprintln!("WARN: Added `{}` instead of `{}`", dep.name, crate_name); | |
} |
This happens because the registry does correct this.
Feature :
Now, when we want to remove a dependency but specify the wrong separator (dash or underscore), it errors out and exit.
Would it be possible to remove a dependency using another separator in cargo rm
? Or would it cost too much to implement ?
I didn't have the time to look deeper in the code, but I can try a PR.
Thanks for any further suggestions or approval.