@@ -33,8 +33,7 @@ $ mv main.rs src/main.rs
33
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.
36
+ want to make a library instead, we should use ` lib.rs ` .
38
37
Custom file locations for the entry point can be specified
39
38
with a [ ` [[lib]] ` or ` [[bin]] ` ] [ crates-custom ] key in the TOML file described below.
40
39
@@ -63,17 +62,18 @@ version = "0.0.1"
63
62
authors = [
" Your name <[email protected] >" ]
64
63
```
65
64
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,
65
+ This file is in the [ TOML] [ toml ] format. Let’s let it explain itself to you:
68
66
69
67
> TOML aims to be a minimal configuration file format that's easy to read due
70
68
> to obvious semantics. TOML is designed to map unambiguously to a hash table.
71
69
> TOML should be easy to parse into data structures in a wide variety of
72
70
> languages.
73
71
72
+ TOML is very similar to INI, but with some extra goodies.
73
+
74
74
[ toml ] : https://github.com/toml-lang/toml
75
75
76
- Once you have this file in place, we should be ready to build! To do so, run :
76
+ Once you have this file in place, we should be ready to build! Try this :
77
77
78
78
``` bash
79
79
$ cargo build
@@ -82,7 +82,7 @@ $ ./target/debug/hello_world
82
82
Hello, world!
83
83
```
84
84
85
- Bam! We built our project with ` cargo build ` , and ran it with
85
+ Bam! We build our project with ` cargo build ` , and run it with
86
86
` ./target/debug/hello_world ` . We can do both in one step with ` cargo run ` :
87
87
88
88
``` bash
@@ -103,9 +103,9 @@ Hello, world!
103
103
```
104
104
105
105
This hasn’t bought us a whole lot over our simple use of ` rustc ` , but think
106
- about the future: when our project gets more complex, we need to do more
106
+ about the future: when our project gets more complex, we would need to do more
107
107
things to get all of the parts to properly compile. With Cargo, as our project
108
- grows, we can just run ` cargo build ` , and it’ll work the right way.
108
+ grows, we can just ` cargo build ` , and it’ll work the right way.
109
109
110
110
When your project is finally ready for release, you can use
111
111
` cargo build --release ` to compile your project with optimizations.
@@ -118,7 +118,7 @@ name = "hello_world"
118
118
version = " 0.0.1"
119
119
```
120
120
121
- The ` Cargo.lock ` file is used by Cargo to keep track of dependencies in your application.
121
+ This file is used by Cargo to keep track of dependencies in your application.
122
122
Right now, we don’t have any, so it’s a bit sparse. You won't ever need
123
123
to touch this file yourself, just let Cargo handle it.
124
124
@@ -170,7 +170,7 @@ This is all we need to get started. First, let’s check out `Cargo.toml`:
170
170
[package ]
171
171
172
172
name = " hello_world"
173
- version = " 0.0.1 "
173
+ version = " 0.1.0 "
174
174
authors = [
" Your Name <[email protected] >" ]
175
175
```
176
176
0 commit comments