Is it good practice to call crates "hello-world", "hello_world" or does it not matter?

I've seen both ways, e.g. or I know I was confused the first time that a crate is called like handlebars-markdown-helper, but it is used like extern crate handlebars_markdown_helper. (However I was only confused the first time. It's not a problem for me now.)


The - to _ thing didn't always exist, so you'll see a lot of earlier projects use _. The convention is generally to use -.

1 Like

Thank you for your feedback. I'll point this out in my tutorial :slight_smile:

Based on @steveklabnik's comment I filed these two tickets to encourage hyphens. Cargo should allow dependencies to be specified using hyphens where the crate name contains underscores, and should display hyphens instead of underscores in all crate names in the UI.