Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCargo should warn when creating a new project with a hyphen #380
Comments
This comment has been minimized.
This comment has been minimized.
|
Does the guide still have a hyphen in it somewhere, or did you just typo? |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
We already have warnings for things that are considered bad style, but are valid syntax. |
This comment has been minimized.
This comment has been minimized.
|
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! |
arpd commentedAug 15, 2014
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.