diff options
| author | Alex Burka <durka42+github@gmail.com> | 2015-09-05 16:42:46 -0400 |
|---|---|---|
| committer | Alex Burka <durka42+github@gmail.com> | 2015-09-05 16:42:46 -0400 |
| commit | a506b7c53237271cce1f794535d4a3203a84a559 (patch) | |
| tree | 29a87d47da9fbfa224cf2a356c75f5e48509a0dd | |
| parent | 2cebf3666aababe58212f1102d077903042983fb (diff) | |
| download | rust-a506b7c53237271cce1f794535d4a3203a84a559.tar.gz rust-a506b7c53237271cce1f794535d4a3203a84a559.zip | |
mention dash-to-underscore behavior
| -rw-r--r-- | src/doc/trpl/crates-and-modules.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/doc/trpl/crates-and-modules.md b/src/doc/trpl/crates-and-modules.md index 0788f0adf88..1c5115117cb 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 |
