]> git.lizzy.rs Git - rust.git/commitdiff
trpl: clarify lib.rs vs main.rs
authorManish Goregaokar <manishsmail@gmail.com>
Mon, 27 Apr 2015 08:52:15 +0000 (14:22 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Mon, 27 Apr 2015 13:12:19 +0000 (18:42 +0530)
src/doc/trpl/hello-cargo.md

index 6967532a44735199cbd29c9d532de914ce51b8b4..d547451fccec2e551193a062e906c5da3de7971d 100644 (file)
@@ -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