]> git.lizzy.rs Git - rust.git/commitdiff
mention dash-to-underscore behavior
authorAlex Burka <durka42+github@gmail.com>
Sat, 5 Sep 2015 20:42:46 +0000 (16:42 -0400)
committerAlex Burka <durka42+github@gmail.com>
Sat, 5 Sep 2015 20:42:46 +0000 (16:42 -0400)
src/doc/trpl/crates-and-modules.md

index 0788f0adf88f9278d9b6cb1a7c57f8e895e88d10..1c5115117cb17f7b4a4afa7159895f2d09b741f0 100644 (file)
@@ -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