-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo should warn when creating a new project with a hyphen #380
Comments
👍 Does the guide still have a hyphen in it somewhere, or did you just typo? |
Rustc has explicit support for allowing crate names with hyphens, and I personally believe they're more aesthetically appealing than underscores. I also personally wouldn't want cargo to warn about something which is valid rust syntax. I'm curious, but what led you to expect |
The guide didn't have a hyphen in it, but nor did it mention that you'd have to use different syntax for hyphenated names. In this case, I think you're definitely correct, perhaps instead this should be mentioned in the guide. |
We already have warnings for things that are considered bad style, but are valid syntax. |
The current plan of record is to actually encourage packages with hyphens in them. They are often more aesthetically appealing and are sometimes more natural to type as well. This is likely a trend that will develop over time with the cargo ecosystem (especially when a registry appears). For now I'm going to close this as I don't think we'd like to do this at this time, but we can certainly revisit this if it looks like it's becoming a more official trend! |
Cargo doesn't warn about hyphenated crate names, although it means that you'll need to:
extern crate foo = "foo-bar"
Rather than:
extern crate foo-bar
Following along with the guide this threw me for a minute.
The text was updated successfully, but these errors were encountered: