File tree Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " foo"
3
+ version = " 0.1.0"
4
+ authors = [" steveklabnik <steve@steveklabnik.com>" ]
5
+
6
+ [dependencies ]
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ println ! ( "Hello, world!" ) ;
3
+ }
Original file line number Diff line number Diff line change 5
5
## What are editions?
6
6
7
7
- [ What are editions?] ( editions/index.md )
8
+ - [ Creating a new project] ( editions/creating-a-new-project.md )
8
9
- [ Transitioning your code to a new edition] ( editions/transitioning-your-code-to-a-new-edition.md )
9
10
10
11
## Rust 2015
Original file line number Diff line number Diff line change
1
+ # Creating a new project
2
+
3
+ When you create a new project with Cargo, it will automatically add
4
+ configuration for the latest edition:
5
+
6
+ ``` rust
7
+ > cargo + nightly new foo
8
+ Created binary (application ) `foo ` project
9
+ > cat . \foo \Cargo . toml
10
+ [package ]
11
+ name = " foo"
12
+ version = " 0.1.0"
13
+ authors = [" your name <you@example.com>" ]
14
+ edition = " 2018"
15
+
16
+ [dependencies ]
17
+ ```
18
+
19
+ That ` edition = "2018" ` setting will configure your package to use Rust 2018.
20
+ No more configuration needed!
21
+
22
+ If you'd prefer to use an older edition, you can change the value in that
23
+ key, for example:
24
+
25
+ ``` rust
26
+ [package ]
27
+ name = " foo"
28
+ version = " 0.1.0"
29
+ authors = [" your name <you@example.com>" ]
30
+ edition = " 2015"
31
+
32
+ [dependencies ]
33
+ ```
34
+
35
+ This will build your package in Rust 2015.
You can’t perform that action at this time.
0 commit comments