Skip to content

Commit eec378d

Browse files
committed
trpl: clarify lib.rs vs main.rs
1 parent 43a273f commit eec378d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: src/doc/trpl/hello-cargo.md

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ $ mkdir src
3232
$ mv main.rs src/main.rs
3333
```
3434

35+
Note that since we're creating an executable, we used `main.rs`. If we
36+
want to make a compiled library instead, we should use `lib.rs`.
37+
Custom file locations for the entry point can be specified
38+
with a [`[[lib]]` or `[[bin]]`][crates-custom] key in the TOML file described below.
39+
40+
[crates-custom]: http://doc.crates.io/manifest.html#configuring-a-target
41+
3542
Cargo expects your source files to live inside a `src` directory. That leaves
3643
the top level for other things, like READMEs, license information, and anything
3744
not related to your code. Cargo helps us keep our projects nice and tidy. A

0 commit comments

Comments
 (0)