@@ -8,13 +8,13 @@ so it is assumed that Rust projects will use Cargo from the beginning.
8
8
[ cratesio ] : http://doc.crates.io
9
9
10
10
Cargo manages three things: building your code, downloading the dependencies
11
- your code needs, and building those dependencies. At first, your
12
- program doesn’t have any dependencies, so we’ll only be using the first part of
13
- its functionality. Eventually, we’ll add more. Since we started off by using
14
- Cargo, it'll be easy to add later.
11
+ your code needs, and building those dependencies. At first, your program doesn’t
12
+ have any dependencies, so we’ll only be using the first part of its
13
+ functionality. Eventually, we’ll add more. Since we started off by using Cargo,
14
+ it'll be easy to add later.
15
15
16
- If you installed Rust via the official installers you will also have Cargo. If
17
- you installed Rust some other way, you may want to [ check the Cargo
16
+ If we installed Rust via the official installers we will also have Cargo. If we
17
+ installed Rust some other way, we may want to [ check the Cargo
18
18
README] [ cargoreadme ] for specific instructions about installing it.
19
19
20
20
[ cargoreadme ] : https://github.com/rust-lang/cargo#installing-cargo-from-nightlies
@@ -25,18 +25,18 @@ Let’s convert Hello World to Cargo.
25
25
26
26
To Cargo-ify our project, we need to do three things: Make a ` Cargo.toml `
27
27
configuration file, put our source file in the right place, and get rid of the
28
- old ` main.exe ` . Let's do that part first:
28
+ old executable ( ` main.exe ` on Windows, ` main ` everywhere else) . Let's do that part first:
29
29
30
30
``` bash
31
31
$ mkdir src
32
32
$ mv main.rs src/main.rs
33
- $ rm main.exe
33
+ $ rm main # or main .exe on Windows
34
34
```
35
35
36
36
Note that since we're creating an executable, we retain ` main.rs ` as the source
37
37
filename. If we want to make a library instead, we should use ` lib.rs ` . This
38
38
convention is required for Cargo to successfully compile our projects, but it
39
- can be overridden if we wish. Custom file locations for the entry point can be
39
+ can be overridden if we wish. Custom file locations for the entry point can be
40
40
specified with a [ ` [lib] ` or ` [[bin]] ` ] [ crates-custom ] key in the TOML file.
41
41
42
42
[ crates-custom ] : http://doc.crates.io/manifest.html#configuring-a-target
0 commit comments