Skip to content

Commit 58fbfb0

Browse files
committed
Add 'start a new project' page
Fixes #102
1 parent 8cdee8e commit 58fbfb0

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

foo/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "foo"
3+
version = "0.1.0"
4+
authors = ["steveklabnik <steve@steveklabnik.com>"]
5+
6+
[dependencies]

foo/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
## What are editions?
66

77
- [What are editions?](editions/index.md)
8+
- [Creating a new project](editions/creating-a-new-project.md)
89
- [Transitioning your code to a new edition](editions/transitioning-your-code-to-a-new-edition.md)
910

1011
## Rust 2015
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.

0 commit comments

Comments
 (0)