This is already unrelated. lib.name
is already unrelated to package.name
. The package error-chain
provides the crate error_chain
, the package lazy_static
provides the crate lazy_static
, the package pistoncore-glutin_window
provided the crate glutin_window
.
That last one is actually the perfect illustration of how this "ad hoc" namespacing would work (and does, currently, for the ad hoc users!).
This is not a problem, because you specify the package name in Cargo.toml
, which is decoupled from the crate name. If the package old.unmaintained
provides the crate package
, and you want to replace it with package new.maintained
's version of the crate package
, you just s/old.unmaintained/new.maintained
in your Cargo.toml
and it just works the same as the substitution in maven.pom
.
This is not anything to do with namespacing. This is the decoupling of package and library names.
EDIT:
This has nothing to do with how you specify the package. This has everything to do with the library name. These two things are not the same. Please, avoiding conflating the two will help the discussion. Changing the package provider of a library crate is the exact same, no matter how you specify the package.