Skip to content

Commit 0bb3a13

Browse files
committed
Update ch. 7-20 to current origin
1 parent 6a58afa commit 0bb3a13

File tree

1,056 files changed

+15038
-19863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,056 files changed

+15038
-19863
lines changed

listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[package]
22
name = "guessing_game"
33
version = "0.1.0"
4-
authors = ["Your Name <you@example.com>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
87

listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn main() {
2525
// ANCHOR_END: expect
2626

2727
// ANCHOR: print_guess
28-
println!("You guessed: {}", guess);
28+
println!("You guessed: {guess}");
2929
// ANCHOR_END: print_guess
3030
}
3131
// ANCHOR: all

listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock

+41-45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[package]
22
name = "guessing_game"
33
version = "0.1.0"
4-
authors = ["Your Name <you@example.com>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
87

98
[dependencies]
10-
rand = "0.5.5"
9+
rand = "0.8.3"

listings/ch02-guessing-game-tutorial/listing-02-02/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ fn main() {
1111
.read_line(&mut guess)
1212
.expect("Failed to read line");
1313

14-
println!("You guessed: {}", guess);
14+
println!("You guessed: {guess}");
1515
}

listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.lock

+83
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[package]
22
name = "guessing_game"
33
version = "0.1.0"
4-
authors = ["Your Name <you@example.com>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
87

98
[dependencies]
10-
rand = "0.5.5"
9+
rand = "0.8.3"

listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ fn main() {
88
println!("Guess the number!");
99

1010
// ANCHOR: ch07-04
11-
let secret_number = rand::thread_rng().gen_range(1, 101);
11+
let secret_number = rand::thread_rng().gen_range(1..=100);
1212
// ANCHOR_END: ch07-04
1313

14-
println!("The secret number is: {}", secret_number);
14+
println!("The secret number is: {secret_number}");
1515

1616
println!("Please input your guess.");
1717

@@ -21,7 +21,7 @@ fn main() {
2121
.read_line(&mut guess)
2222
.expect("Failed to read line");
2323

24-
println!("You guessed: {}", guess);
24+
println!("You guessed: {guess}");
2525
// ANCHOR: ch07-04
2626
}
2727
// ANCHOR_END: ch07-04

listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.lock

+83
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[package]
22
name = "guessing_game"
33
version = "0.1.0"
4-
authors = ["Your Name <you@example.com>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
87

98
[dependencies]
10-
rand = "0.5.5"
9+
rand = "0.8.3"

0 commit comments

Comments
 (0)