Skip to content

Commit

Permalink
Rust 1.82: also update all cases of manual regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskrycho committed Nov 6, 2024
1 parent f4b2254 commit f04d20f
Show file tree
Hide file tree
Showing 35 changed files with 288 additions and 232 deletions.
77 changes: 71 additions & 6 deletions listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ name = "guessing_game"
version = "0.1.0"
edition = "2021"

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

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
$ cargo run
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.50s
Running `target/debug/guessing_game`
Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.80s
Running `file:///projects/guessing_game/target/debug/guessing_game`
Hello, world!

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ name = "adder"
version = "0.1.0"
edition = "2021"

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

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$ cargo test
Compiling adder v0.1.0 (file:///projects/adder)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.57s
Running unittests src/lib.rs (target/debug/deps/adder-92948b65e88960b4)
Running unittests src/lib.rs (file:///projects/adder/target/debug/deps/adder-7acb243c25ffd9dc)

running 1 test
test tests::it_works ... ok
Expand All @@ -13,4 +13,3 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
7 changes: 2 additions & 5 deletions listings/ch14-more-about-cargo/listing-14-07/add/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]

members = [
"adder",
"add_one",
]
resolver = "2"
members = ["adder", "add_one"]

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[workspace]
resolver = "2"
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]

members = [
"adder",
"add_one",
]
resolver = "2"
members = ["adder", "add_one"]
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]

members = [
"adder",
"add_one",
]
resolver = "2"
members = ["adder", "add_one"]
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]

members = [
"adder",
"add_one",
]
resolver = "2"
members = ["adder", "add_one"]
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[workspace]

members = [
"adder",
]
resolver = "2"
members = ["adder"]
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]

members = [
"adder",
"add_one",
]
resolver = "2"
members = [ "add_one","adder"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ name = "add_one"
version = "0.1.0"
edition = "2021"

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

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub fn add(left: usize, right: usize) -> usize {
pub fn add(left: u64, right: u64) -> u64 {
left + right
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[workspace]

members = [
"adder",
"add_one",
]
resolver = "2"
members = ["adder", "add_one"]
46 changes: 27 additions & 19 deletions src/ch02-00-guessing-game-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ input 6 -->
```console
$ cargo run
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished dev [unoptimized + debuginfo] target(s) in 6.44s
Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.44s
Running `target/debug/guessing_game`
Guess the number!
Please input your guess.
Expand Down Expand Up @@ -380,22 +380,28 @@ cargo build -->
```console
$ cargo build
Updating crates.io index
Downloaded rand v0.8.5
Downloaded libc v0.2.127
Downloaded getrandom v0.2.7
Downloaded cfg-if v1.0.0
Downloaded ppv-lite86 v0.2.16
Downloaded rand_chacha v0.3.1
Downloaded rand_core v0.6.3
Compiling libc v0.2.127
Compiling getrandom v0.2.7
Locking 16 packages to latest compatible versions
Adding wasi v0.11.0+wasi-snapshot-preview1 (latest: v0.13.3+wasi-0.2.2)
Adding zerocopy v0.7.35 (latest: v0.8.9)
Adding zerocopy-derive v0.7.35 (latest: v0.8.9)
Downloaded syn v2.0.87
Downloaded 1 crate (278.1 KB) in 0.16s
Compiling proc-macro2 v1.0.89
Compiling unicode-ident v1.0.13
Compiling libc v0.2.161
Compiling cfg-if v1.0.0
Compiling ppv-lite86 v0.2.16
Compiling rand_core v0.6.3
Compiling byteorder v1.5.0
Compiling getrandom v0.2.15
Compiling rand_core v0.6.4
Compiling quote v1.0.37
Compiling syn v2.0.87
Compiling zerocopy-derive v0.7.35
Compiling zerocopy v0.7.35
Compiling ppv-lite86 v0.2.20
Compiling rand_chacha v0.3.1
Compiling rand v0.8.5
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished dev [unoptimized + debuginfo] target(s) in 2.53s
Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.69s
```

</Listing>
Expand Down Expand Up @@ -433,7 +439,7 @@ cargo build -->
```console
$ cargo build
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished dev [unoptimized + debuginfo] target(s) in 2.53 secs
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.13s
```

These lines show that Cargo only updates the build with your tiny change to the
Expand Down Expand Up @@ -557,7 +563,7 @@ cargo run
```console
$ cargo run
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished dev [unoptimized + debuginfo] target(s) in 2.53s
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
Running `target/debug/guessing_game`
Guess the number!
The secret number is: 7
Expand All @@ -566,7 +572,7 @@ Please input your guess.
You guessed: 4

$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.02s
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
Running `target/debug/guessing_game`
Guess the number!
The secret number is: 83
Expand Down Expand Up @@ -717,14 +723,15 @@ Let’s run the program now:

<!-- manual-regeneration
cd listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/
touch src/main.rs
cargo run
76
-->

```console
$ cargo run
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.26s
Running `target/debug/guessing_game`
Guess the number!
The secret number is: 58
Expand Down Expand Up @@ -767,6 +774,7 @@ advantage of that to allow the user to quit, as shown here:

<!-- manual-regeneration
cd listings/ch02-guessing-game-tutorial/no-listing-04-looping/
touch src/main.rs
cargo run
(too small guess)
(too big guess)
Expand All @@ -777,7 +785,7 @@ quit
```console
$ cargo run
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished dev [unoptimized + debuginfo] target(s) in 1.50s
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.23s
Running `target/debug/guessing_game`
Guess the number!
The secret number is: 59
Expand Down Expand Up @@ -868,7 +876,7 @@ foo
```console
$ cargo run
Compiling guessing_game v0.1.0 (file:///projects/guessing_game)
Finished dev [unoptimized + debuginfo] target(s) in 4.45s
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.13s
Running `target/debug/guessing_game`
Guess the number!
The secret number is: 61
Expand Down
Loading

0 comments on commit f04d20f

Please sign in to comment.