Skip to content

Commit a6d672b

Browse files
committed
Auto merge of #6752 - ea2973929:cargo-book-2.4-dependencies-use-2018, r=ehuss
Don't need extern crate in 2018 The example in 2.4 Dependencies uses `extern crate` which you don't need in edition 2018. As a beginner Rustacean I find it's confusing that so many examples are still using `extern crate` so here is a pull request to fix that.
2 parents efd29db + d3c7f13 commit a6d672b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/doc/src/guide/dependencies.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ crates:
3535
name = "hello_world"
3636
version = "0.1.0"
3737
authors = ["Your Name <[email protected]>"]
38+
edition = "2018"
3839

3940
[dependencies]
4041
time = "0.1.12"
@@ -68,11 +69,9 @@ these dependencies we used.
6869
Now, if `regex` gets updated, we will still build with the same revision until
6970
we choose to `cargo update`.
7071

71-
You can now use the `regex` library using `extern crate` in `main.rs`.
72+
You can now use the `regex` library in `main.rs`.
7273

7374
```rust
74-
extern crate regex;
75-
7675
use regex::Regex;
7776

7877
fn main() {

0 commit comments

Comments
 (0)