3 ms·
I feel like cargo should have gone further and made it borderline impossible to write out the package name from a guess and require you to look it up and copy/p
by Gigachad 4y ago
I feel like cargo should have gone further and made it borderline impossible to write out the package name from a guess and require you to look it up and copy/paste the name so its always right. They should have required all packages to be scoped under an org name like NPM is moving towards.
That would have stopped typo squatting much better than making names insensitive to all kinds of weird conventions.
- maxbond 4y agoI think it would've been sufficient to namespace package names, something like `dtolnay::syn = "1"` (this is terrible syntax, just an example). Perhaps also allow Cargo to be configured to fail if any of the packages were outside of an allowlist of trusted namespaces. I think this is a good compromise between allowing people to experiment quickly and allowing established projects to lock themselves down.
- hobofan 4y agoThere is some promising work going towards bringing namespaces to Cargo: https://github.com/rust-lang/rfcs/pull/3243 https://github.com/rust-lang/rfcs/pull/3243