diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-04-27 10:26:19 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-04-27 10:26:19 -0400 |
| commit | be569bcd3591204825c02874d9bdbc9d6bc5fa1d (patch) | |
| tree | 81322c157c434e5a26bd233ce167b2019b5d393b | |
| parent | 30f41b1bd672a2ceb6ed60895448fef1722ffc5d (diff) | |
| parent | 38042d1e18bc37dac34c74e094a3678b4c613a7a (diff) | |
| download | rust-be569bcd3591204825c02874d9bdbc9d6bc5fa1d.tar.gz rust-be569bcd3591204825c02874d9bdbc9d6bc5fa1d.zip | |
Rollup merge of #24860 - Manishearth:cargo-doc, r=steveklabnik
A user in IRC was having trouble because they used `main.rs` when they were trying to migrate a library. The `[[lib]]` key is not easily found, and the `main.rs`/`lib.rs` distinction doesn't seem to exist in trpl r? @steveklabnik
| -rw-r--r-- | src/doc/trpl/hello-cargo.md | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/doc/trpl/hello-cargo.md b/src/doc/trpl/hello-cargo.md index 6967532a447..d547451fcce 100644 --- a/src/doc/trpl/hello-cargo.md +++ b/src/doc/trpl/hello-cargo.md @@ -32,6 +32,13 @@ $ mkdir src $ mv main.rs src/main.rs ``` +Note that since we're creating an executable, we used `main.rs`. If we +want to make a library instead, we should use `lib.rs`. +Custom file locations for the entry point can be specified +with a [`[[lib]]` or `[[bin]]`][crates-custom] key in the TOML file described below. + +[crates-custom]: http://doc.crates.io/manifest.html#configuring-a-target + Cargo expects your source files to live inside a `src` directory. That leaves the top level for other things, like READMEs, license information, and anything not related to your code. Cargo helps us keep our projects nice and tidy. A |
