@@ -23,20 +23,21 @@ README][cargoreadme] for specific instructions about installing it.
23
23
24
24
Let’s convert Hello World to Cargo.
25
25
26
- To Cargo-ify our project, we need to do two things: Make a ` Cargo.toml `
27
- configuration file, and put our source file in the right place. Let's
28
- do that part first:
26
+ To Cargo-ify our project, we need to do three things: Make a ` Cargo.toml `
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:
29
29
30
30
``` bash
31
31
$ mkdir src
32
32
$ mv main.rs src/main.rs
33
+ $ rm main.exe
33
34
```
34
35
35
- Note that since we're creating an executable, we used ` main.rs ` . If we
36
- want to make a library instead, we should use ` lib.rs ` . This convention is required
37
- for Cargo to successfully compile our projects, but it can be overridden if we wish.
38
- Custom file locations for the entry point can be specified
39
- with a [ ` [lib] ` or ` [[bin]] ` ] [ crates-custom ] key in the TOML file.
36
+ Note that since we're creating an executable, we retain ` main.rs ` as the source
37
+ filename. If we want to make a library instead, we should use ` lib.rs ` . This
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
40
+ specified with a [ ` [lib] ` or ` [[bin]] ` ] [ crates-custom ] key in the TOML file.
40
41
41
42
[ crates-custom ] : http://doc.crates.io/manifest.html#configuring-a-target
42
43
@@ -63,8 +64,8 @@ version = "0.0.1"
63
64
authors = [
" Your name <[email protected] >" ]
64
65
```
65
66
66
- This file is in the [ TOML] [ toml ] format. TOML is similar to INI, but has some
67
- extra goodies. According to the TOML docs,
67
+ This file is in the [ TOML] [ toml ] format. TOML is similar to INI, but has some
68
+ extra goodies. According to the TOML docs,
68
69
69
70
> TOML aims to be a minimal configuration file format that's easy to read due
70
71
> to obvious semantics. TOML is designed to map unambiguously to a hash table.
@@ -73,7 +74,8 @@ extra goodies. According to the TOML docs,
73
74
74
75
[ toml ] : https://github.com/toml-lang/toml
75
76
76
- Once you have this file in place, we should be ready to build! To do so, run:
77
+ Once you have this file in place in your project's root directory, we should be
78
+ ready to build! To do so, run:
77
79
78
80
``` bash
79
81
$ cargo build
0 commit comments