From a506b7c53237271cce1f794535d4a3203a84a559 Mon Sep 17 00:00:00 2001 From: Alex Burka Date: Sat, 5 Sep 2015 16:42:46 -0400 Subject: [PATCH] mention dash-to-underscore behavior --- src/doc/trpl/crates-and-modules.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/trpl/crates-and-modules.md b/src/doc/trpl/crates-and-modules.md index 0788f0adf88f..1c5115117cb1 100644 --- a/src/doc/trpl/crates-and-modules.md +++ b/src/doc/trpl/crates-and-modules.md @@ -263,6 +263,10 @@ the `phrases` crate. We can then use `phrases`’ modules in this one. As we mentioned earlier, you can use double colons to refer to sub-modules and the functions inside of them. +(Note: when importing a crate that has dashes in its name "like-this", which is +not a valid Rust identifier, it will be converted by changing the dashes to +underscores, so you would write `extern crate like_this;`.) + Also, Cargo assumes that `src/main.rs` is the crate root of a binary crate, rather than a library crate. Our package now has two crates: `src/lib.rs` and `src/main.rs`. This pattern is quite common for executable crates: most