diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7aab3ca4f7..9c39ca8c18 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,12 +12,12 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.82 -c rust-docs - rustup default 1.82 + rustup toolchain install 1.85 -c rust-docs + rustup default 1.85 - name: Install mdbook run: | mkdir bin - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin + curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.45/mdbook-v0.4.45-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin echo "$(pwd)/bin" >> "${GITHUB_PATH}" - name: Report versions run: | @@ -47,8 +47,8 @@ jobs: - name: Install Rust run: | rustup set profile minimal - rustup toolchain install 1.82 -c rust-docs - rustup default 1.82 + rustup toolchain install 1.85 -c rust-docs + rustup default 1.85 - name: Run `tools` package tests run: | cargo test diff --git a/book.toml b/book.toml index a17483878f..928a44453f 100644 --- a/book.toml +++ b/book.toml @@ -41,4 +41,4 @@ git-repository-url = "https://github.com/rust-lang/book" output-mode = "default" [rust] -edition = "2021" +edition = "2024" diff --git a/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml b/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml index 78c94fef95..122c1bd074 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/listing-02-01/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml b/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml b/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/listing-02-03/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml b/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/listing-02-04/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt b/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt index 35e21b0a25..e20f503ce5 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt +++ b/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt @@ -18,9 +18,9 @@ error[E0308]: mismatched types = note: expected reference `&String` found reference `&{integer}` note: method defined here - --> file:///home/.rustup/toolchains/1.82/lib/rustlib/src/rust/library/core/src/cmp.rs:838:8 + --> file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/core/src/cmp.rs:964:8 | -838 | fn cmp(&self, other: &Self) -> Ordering; +964 | fn cmp(&self, other: &Self) -> Ordering; | ^^^ For more information about this error, try `rustc --explain E0308`. diff --git a/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml b/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/listing-02-05/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml b/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/listing-02-06/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml b/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml index 4e348c8d26..53e7b397ea 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml b/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml index 78c94fef95..122c1bd074 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml b/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml b/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/no-listing-04-looping/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml b/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml +++ b/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml b/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml +++ b/listings/ch03-common-programming-concepts/listing-03-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml b/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml index 659645556b..b12fd9760a 100644 --- a/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml +++ b/listings/ch03-common-programming-concepts/listing-03-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "branches" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml b/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml index 810e8bbc0a..a046a76338 100644 --- a/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml +++ b/listings/ch03-common-programming-concepts/listing-03-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loops" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml b/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml index 810e8bbc0a..a046a76338 100644 --- a/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml +++ b/listings/ch03-common-programming-concepts/listing-03-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loops" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml b/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml index 810e8bbc0a..a046a76338 100644 --- a/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml +++ b/listings/ch03-common-programming-concepts/listing-03-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loops" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml index 4da3b81504..c093eb645c 100644 --- a/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "variables" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml index 4da3b81504..c093eb645c 100644 --- a/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-02-adding-mut/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "variables" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml index 4da3b81504..c093eb645c 100644 --- a/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-03-shadowing/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "variables" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml index 4da3b81504..c093eb645c 100644 --- a/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-04-shadowing-can-change-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "variables" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml index 4da3b81504..c093eb645c 100644 --- a/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "variables" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml index 83610e7561..c293ee0a55 100644 --- a/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-06-floating-point/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "floating-point" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml index b4bea55e3d..98935b4c2d 100644 --- a/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-07-numeric-operations/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "numeric-operations" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml index 47e42cef8a..4a6f21a0b7 100644 --- a/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-08-boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "boolean" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml index a1ef3b537c..613f326767 100644 --- a/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-09-char/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "char" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml index 9b0879c2c6..29036e9a35 100644 --- a/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-10-tuples/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tuples" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml index 9b0879c2c6..29036e9a35 100644 --- a/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-11-destructuring-tuples/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tuples" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml index 9b0879c2c6..29036e9a35 100644 --- a/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-12-tuple-indexing/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tuples" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml index 96be3e2b17..564293c98f 100644 --- a/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-13-arrays/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "arrays" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml index 96be3e2b17..564293c98f 100644 --- a/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-14-array-indexing/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "arrays" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml index 96be3e2b17..564293c98f 100644 --- a/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-15-invalid-array-access/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "arrays" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-16-functions/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-17-functions-with-parameters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-18-functions-with-multiple-parameters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-20-blocks-are-expressions/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-21-function-return-values/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-22-function-parameter-and-return/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml index 478b346fd5..9c392ab08b 100644 --- a/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml index e0576b5dce..e4bffc604c 100644 --- a/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "comments" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml index e0576b5dce..e4bffc604c 100644 --- a/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "comments" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml index 659645556b..b12fd9760a 100644 --- a/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-26-if-true/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "branches" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml index 659645556b..b12fd9760a 100644 --- a/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-27-if-false/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "branches" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml index 659645556b..b12fd9760a 100644 --- a/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "branches" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml index 659645556b..b12fd9760a 100644 --- a/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-29-if-not-equal-0/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "branches" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml index 659645556b..b12fd9760a 100644 --- a/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-30-else-if/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "branches" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml index 659645556b..b12fd9760a 100644 --- a/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "branches" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.toml index 810e8bbc0a..a046a76338 100644 --- a/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-32-5-loop-labels/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loops" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml index 810e8bbc0a..a046a76338 100644 --- a/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-32-loop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loops" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml index 810e8bbc0a..a046a76338 100644 --- a/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-33-return-value-from-loop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loops" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml b/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml index 810e8bbc0a..a046a76338 100644 --- a/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml +++ b/listings/ch03-common-programming-concepts/no-listing-34-for-range/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "loops" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml b/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml index 8ad4d5aa6b..05020d2765 100644 --- a/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml +++ b/listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "no_type_annotations" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml +++ b/listings/ch04-understanding-ownership/listing-04-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs b/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs index 15bc9d9220..37f33d13c0 100644 --- a/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs +++ b/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs @@ -5,5 +5,5 @@ fn main() { s.push_str(", world!"); // push_str() appends a literal to a String println!("{s}"); // This will print `hello, world!` - // ANCHOR_END: here + // ANCHOR_END: here } diff --git a/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-03-string-move/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-04b-replacement-drop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-05-clone/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-06-copy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-07-reference/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-08-reference-with-annotations/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-09-fixes-listing-04-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-11-muts-in-separate-scopes/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-13-reference-scope-ends/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-14-dangling-reference/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-15-dangling-reference-annotated/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-16-no-dangle/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-17-slice/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-18-first-word-slice/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml +++ b/listings/ch04-understanding-ownership/no-listing-19-slice-error/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/listing-05-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-01-tuple-structs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml index d36dbc1d34..748f9d6dfc 100644 --- a/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-03-associated-functions/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.toml index 3232b60653..7251aaa8de 100644 --- a/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-04-unit-like-structs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "structs" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/no-listing-06-method-field-interaction/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml b/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml +++ b/listings/ch05-using-structs-to-structure-related-data/output-only-02-pretty-debug/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-08/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-08/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-08/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-09/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-09/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/listing-06-09/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-02-enum-with-data/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-03-variants-with-different-data/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs b/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs index df451be8b6..fb3ff249ac 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs +++ b/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs @@ -6,6 +6,6 @@ struct MoveMessage { } struct WriteMessage(String); // tuple struct struct ChangeColorMessage(i32, i32, i32); // tuple struct - // ANCHOR_END: here +// ANCHOR_END: here fn main() {} diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-05-methods-on-enums/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-06-option-examples/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt b/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt index 1eb76de43f..78e064d990 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt +++ b/listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt @@ -8,8 +8,8 @@ error[E0277]: cannot add `Option` to `i8` | = help: the trait `Add>` is not implemented for `i8` = help: the following other types implement trait `Add`: - `&'a i8` implements `Add` - `&i8` implements `Add<&i8>` + `&i8` implements `Add` + `&i8` implements `Add` `i8` implements `Add<&i8>` `i8` implements `Add` diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-08-match-arm-multiple-lines/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-09-variable-in-pattern/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt b/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt index 8cf3aa0749..10c3d2eb86 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt +++ b/listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt @@ -7,12 +7,12 @@ error[E0004]: non-exhaustive patterns: `None` not covered | ^ pattern `None` not covered | note: `Option` defined here - --> file:///home/.rustup/toolchains/1.82/lib/rustlib/src/rust/library/core/src/option.rs:571:1 + --> file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/core/src/option.rs:572:1 | -571 | pub enum Option { +572 | pub enum Option { | ^^^^^^^^^^^^^^^^^^ ... -575 | None, +576 | None, | ---- not covered = note: the matched value is of type `Option` help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-12-if-let/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-13-count-and-announce-match/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-14-count-and-announce-if-let-else/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-15-binding-catchall/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-16-underscore-catchall/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.toml b/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.toml index e959295f91..d4e6b38af1 100644 --- a/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/no-listing-17-underscore-unit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-01/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-01/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-01/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-03/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-03/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-03/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-05/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-05/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-05/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-05/output.txt b/listings/ch07-managing-growing-projects/listing-07-05/output.txt index 98d8d6e2aa..199e8a9ede 100644 --- a/listings/ch07-managing-growing-projects/listing-07-05/output.txt +++ b/listings/ch07-managing-growing-projects/listing-07-05/output.txt @@ -1,21 +1,21 @@ $ cargo build Compiling restaurant v0.1.0 (file:///projects/restaurant) error[E0603]: function `add_to_waitlist` is private - --> src/lib.rs:9:37 - | -9 | crate::front_of_house::hosting::add_to_waitlist(); - | ^^^^^^^^^^^^^^^ private function - | + --> src/lib.rs:10:37 + | +10 | crate::front_of_house::hosting::add_to_waitlist(); + | ^^^^^^^^^^^^^^^ private function + | note: the function `add_to_waitlist` is defined here - --> src/lib.rs:3:9 - | -3 | fn add_to_waitlist() {} - | ^^^^^^^^^^^^^^^^^^^^ + --> src/lib.rs:3:9 + | +3 | fn add_to_waitlist() {} + | ^^^^^^^^^^^^^^^^^^^^ error[E0603]: function `add_to_waitlist` is private - --> src/lib.rs:12:30 + --> src/lib.rs:13:30 | -12 | front_of_house::hosting::add_to_waitlist(); +13 | front_of_house::hosting::add_to_waitlist(); | ^^^^^^^^^^^^^^^ private function | note: the function `add_to_waitlist` is defined here diff --git a/listings/ch07-managing-growing-projects/listing-07-07/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-07/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-07/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-08/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-08/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-08/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-09/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-09/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-09/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-10/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-10/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-10/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-11/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-11/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-11/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-12/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-12/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-12/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-13/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-13/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-13/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-14/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-14/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-14/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-15/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-15/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-15/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-16/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-16/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-16/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-17/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-17/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-17/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-18/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-18/Cargo.toml index d508e9578d..9f9c4acb96 100644 --- a/listings/ch07-managing-growing-projects/listing-07-18/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-18/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] rand = "0.8.5" diff --git a/listings/ch07-managing-growing-projects/listing-07-19/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-19/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-19/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-20/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-20/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-20/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.toml b/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.toml +++ b/listings/ch07-managing-growing-projects/listing-07-21-and-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.toml b/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.toml index 7eda67aeaf..eba27a883c 100644 --- a/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.toml +++ b/listings/ch07-managing-growing-projects/no-listing-01-use-std-unnested/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.toml b/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.toml index 60cec7cb01..8e47b7abe8 100644 --- a/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.toml +++ b/listings/ch07-managing-growing-projects/no-listing-02-extracting-hosting/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restaurant" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.toml b/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.toml index 6e904abbe7..49be9c5947 100644 --- a/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.toml +++ b/listings/ch07-managing-growing-projects/quick-reference-example/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "backyard" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-01/Cargo.toml b/listings/ch08-common-collections/listing-08-01/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-01/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-02/Cargo.toml b/listings/ch08-common-collections/listing-08-02/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-02/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-03/Cargo.toml b/listings/ch08-common-collections/listing-08-03/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-03/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-04/Cargo.toml b/listings/ch08-common-collections/listing-08-04/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-04/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-05/Cargo.toml b/listings/ch08-common-collections/listing-08-05/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-05/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-06/Cargo.toml b/listings/ch08-common-collections/listing-08-06/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-06/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-07/Cargo.toml b/listings/ch08-common-collections/listing-08-07/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-07/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-08/Cargo.toml b/listings/ch08-common-collections/listing-08-08/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-08/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-09/Cargo.toml b/listings/ch08-common-collections/listing-08-09/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-09/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-10/Cargo.toml b/listings/ch08-common-collections/listing-08-10/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-10/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-10/src/main.rs b/listings/ch08-common-collections/listing-08-10/src/main.rs index abda2db660..a7d2dfa569 100644 --- a/listings/ch08-common-collections/listing-08-10/src/main.rs +++ b/listings/ch08-common-collections/listing-08-10/src/main.rs @@ -5,5 +5,5 @@ fn main() { // do stuff with v } // <- v goes out of scope and is freed here - // ANCHOR_END: here + // ANCHOR_END: here } diff --git a/listings/ch08-common-collections/listing-08-11/Cargo.toml b/listings/ch08-common-collections/listing-08-11/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-11/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-12/Cargo.toml b/listings/ch08-common-collections/listing-08-12/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-12/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-13/Cargo.toml b/listings/ch08-common-collections/listing-08-13/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-13/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-14/Cargo.toml b/listings/ch08-common-collections/listing-08-14/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-14/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-15/Cargo.toml b/listings/ch08-common-collections/listing-08-15/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-15/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-16/Cargo.toml b/listings/ch08-common-collections/listing-08-16/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-16/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-17/Cargo.toml b/listings/ch08-common-collections/listing-08-17/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-17/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-18/Cargo.toml b/listings/ch08-common-collections/listing-08-18/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-18/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-18/src/main.rs b/listings/ch08-common-collections/listing-08-18/src/main.rs index 93939a69fb..8e55dc5116 100644 --- a/listings/ch08-common-collections/listing-08-18/src/main.rs +++ b/listings/ch08-common-collections/listing-08-18/src/main.rs @@ -3,5 +3,5 @@ fn main() { let s1 = String::from("Hello, "); let s2 = String::from("world!"); let s3 = s1 + &s2; // note s1 has been moved here and can no longer be used - // ANCHOR_END: here + // ANCHOR_END: here } diff --git a/listings/ch08-common-collections/listing-08-19/Cargo.toml b/listings/ch08-common-collections/listing-08-19/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-19/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-19/output.txt b/listings/ch08-common-collections/listing-08-19/output.txt index 75d9a56f54..2684a25a49 100644 --- a/listings/ch08-common-collections/listing-08-19/output.txt +++ b/listings/ch08-common-collections/listing-08-19/output.txt @@ -6,10 +6,10 @@ error[E0277]: the type `str` cannot be indexed by `{integer}` 3 | let h = s1[0]; | ^ string indices are ranges of `usize` | - = help: the trait `SliceIndex` is not implemented for `{integer}`, which is required by `String: Index<_>` = note: you can use `.chars().nth()` or `.bytes().nth()` for more information, see chapter 8 in The Book: - = help: the trait `SliceIndex<[_]>` is implemented for `usize` + = help: the trait `SliceIndex` is not implemented for `{integer}` + but trait `SliceIndex<[_]>` is implemented for `usize` = help: for that trait implementation, expected `[_]`, found `str` = note: required for `String` to implement `Index<{integer}>` diff --git a/listings/ch08-common-collections/listing-08-20/Cargo.toml b/listings/ch08-common-collections/listing-08-20/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-20/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-21/Cargo.toml b/listings/ch08-common-collections/listing-08-21/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-21/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-21/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-22/Cargo.toml b/listings/ch08-common-collections/listing-08-22/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-22/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-23/Cargo.toml b/listings/ch08-common-collections/listing-08-23/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-23/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-23/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-24/Cargo.toml b/listings/ch08-common-collections/listing-08-24/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-24/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-24/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/listing-08-25/Cargo.toml b/listings/ch08-common-collections/listing-08-25/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/listing-08-25/Cargo.toml +++ b/listings/ch08-common-collections/listing-08-25/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.toml b/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.toml +++ b/listings/ch08-common-collections/no-listing-01-concat-multiple-strings/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/no-listing-02-format/Cargo.toml b/listings/ch08-common-collections/no-listing-02-format/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/no-listing-02-format/Cargo.toml +++ b/listings/ch08-common-collections/no-listing-02-format/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.toml b/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.toml +++ b/listings/ch08-common-collections/no-listing-03-iterate-over-hashmap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.toml b/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.toml index fe49598234..fd854232dc 100644 --- a/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.toml +++ b/listings/ch08-common-collections/output-only-01-not-char-boundary/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "collections" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt b/listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt index de65b05c07..c66cccca9f 100644 --- a/listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt +++ b/listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt @@ -2,6 +2,7 @@ $ cargo run Compiling collections v0.1.0 (file:///projects/collections) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s Running `target/debug/collections` + thread 'main' panicked at src/main.rs:4:19: byte index 1 is not a char boundary; it is inside 'З' (bytes 0..2) of `Здравствуйте` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch09-error-handling/listing-09-01/Cargo.toml b/listings/ch09-error-handling/listing-09-01/Cargo.toml index 660e2c819d..94b8cffcb7 100644 --- a/listings/ch09-error-handling/listing-09-01/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "panic" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-01/output.txt b/listings/ch09-error-handling/listing-09-01/output.txt index 5f4def0091..2c92e13851 100644 --- a/listings/ch09-error-handling/listing-09-01/output.txt +++ b/listings/ch09-error-handling/listing-09-01/output.txt @@ -2,6 +2,7 @@ $ cargo run Compiling panic v0.1.0 (file:///projects/panic) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s Running `target/debug/panic` + thread 'main' panicked at src/main.rs:4:6: index out of bounds: the len is 3 but the index is 99 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch09-error-handling/listing-09-03/Cargo.toml b/listings/ch09-error-handling/listing-09-03/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-03/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-04/Cargo.toml b/listings/ch09-error-handling/listing-09-04/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-04/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-04/output.txt b/listings/ch09-error-handling/listing-09-04/output.txt index b36bdc05fd..3ecc9c0dc9 100644 --- a/listings/ch09-error-handling/listing-09-04/output.txt +++ b/listings/ch09-error-handling/listing-09-04/output.txt @@ -2,6 +2,7 @@ $ cargo run Compiling error-handling v0.1.0 (file:///projects/error-handling) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.73s Running `target/debug/error-handling` + thread 'main' panicked at src/main.rs:8:23: Problem opening the file: Os { code: 2, kind: NotFound, message: "No such file or directory" } note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch09-error-handling/listing-09-05/Cargo.toml b/listings/ch09-error-handling/listing-09-05/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-05/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-06/Cargo.toml b/listings/ch09-error-handling/listing-09-06/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-06/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-07/Cargo.toml b/listings/ch09-error-handling/listing-09-07/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-07/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-08/Cargo.toml b/listings/ch09-error-handling/listing-09-08/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-08/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-09/Cargo.toml b/listings/ch09-error-handling/listing-09-09/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-09/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-10/Cargo.toml b/listings/ch09-error-handling/listing-09-10/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-10/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-11/Cargo.toml b/listings/ch09-error-handling/listing-09-11/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-11/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-12/Cargo.toml b/listings/ch09-error-handling/listing-09-12/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/listing-09-12/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/listing-09-13/Cargo.toml b/listings/ch09-error-handling/listing-09-13/Cargo.toml index d508e9578d..9f9c4acb96 100644 --- a/listings/ch09-error-handling/listing-09-13/Cargo.toml +++ b/listings/ch09-error-handling/listing-09-13/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] rand = "0.8.5" diff --git a/listings/ch09-error-handling/no-listing-01-panic/Cargo.toml b/listings/ch09-error-handling/no-listing-01-panic/Cargo.toml index 660e2c819d..94b8cffcb7 100644 --- a/listings/ch09-error-handling/no-listing-01-panic/Cargo.toml +++ b/listings/ch09-error-handling/no-listing-01-panic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "panic" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/no-listing-01-panic/output.txt b/listings/ch09-error-handling/no-listing-01-panic/output.txt index ced4ee7198..4268ef1d51 100644 --- a/listings/ch09-error-handling/no-listing-01-panic/output.txt +++ b/listings/ch09-error-handling/no-listing-01-panic/output.txt @@ -2,6 +2,7 @@ $ cargo run Compiling panic v0.1.0 (file:///projects/panic) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.25s Running `target/debug/panic` + thread 'main' panicked at src/main.rs:2:5: crash and burn note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.toml b/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.toml +++ b/listings/ch09-error-handling/no-listing-04-unwrap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/no-listing-05-expect/Cargo.toml b/listings/ch09-error-handling/no-listing-05-expect/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/no-listing-05-expect/Cargo.toml +++ b/listings/ch09-error-handling/no-listing-05-expect/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.toml b/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.toml index c496db7834..225a1e058f 100644 --- a/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.toml +++ b/listings/ch09-error-handling/no-listing-08-unwrap-that-cant-fail/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error-handling" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml b/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml index d508e9578d..9f9c4acb96 100644 --- a/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml +++ b/listings/ch09-error-handling/no-listing-09-guess-out-of-range/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] rand = "0.8.5" diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt index 05b96ca173..54a8c6285b 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt @@ -8,7 +8,7 @@ error[E0369]: binary operation `>` cannot be applied to type `&T` | | | &T | -help: consider restricting type parameter `T` +help: consider restricting type parameter `T` with trait `PartialOrd` | 1 | fn largest(list: &[T]) -> &T { | ++++++++++++++++++++++ diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/src/main.rs b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/src/main.rs index bf41acd1f1..c80cf87a6d 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/src/main.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/src/main.rs @@ -8,10 +8,6 @@ fn main() { // ANCHOR: here fn longest(x: &str, y: &str) -> &str { - if x.len() > y.len() { - x - } else { - y - } + if x.len() > y.len() { x } else { y } } // ANCHOR_END: here diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/src/main.rs b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/src/main.rs index 7668de1340..c7b92f7ba9 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/src/main.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-21/src/main.rs @@ -8,10 +8,6 @@ fn main() { // ANCHOR: here fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { - if x.len() > y.len() { - x - } else { - y - } + if x.len() > y.len() { x } else { y } } // ANCHOR_END: here diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/src/main.rs b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/src/main.rs index fc9ff296cf..b1a24a4086 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/src/main.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-22/src/main.rs @@ -11,9 +11,5 @@ fn main() { // ANCHOR_END: here fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { - if x.len() > y.len() { - x - } else { - y - } + if x.len() > y.len() { x } else { y } } diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs index f2e6338625..a8bc4ef496 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/src/main.rs @@ -11,9 +11,5 @@ fn main() { // ANCHOR_END: here fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { - if x.len() > y.len() { - x - } else { - y - } + if x.len() > y.len() { x } else { y } } diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-24/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.toml index e8847526dc..a4b0049f1d 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-25/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ownership" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.toml index 46f46a7f44..789790bdd8 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aggregator" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/Cargo.toml index 4dbde90901..44949be6d3 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-07-where-clause/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-08-only-one-reference-with-lifetime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-10-lifetimes-on-methods/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.toml b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.toml index 489f809672..a13293a336 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.toml +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chapter10" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/src/main.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/src/main.rs index 4b0201fb16..de3703f907 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/src/main.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-11-generics-traits-and-lifetimes/src/main.rs @@ -22,10 +22,6 @@ where T: Display, { println!("Announcement! {ann}"); - if x.len() > y.len() { - x - } else { - y - } + if x.len() > y.len() { x } else { y } } // ANCHOR_END: here diff --git a/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-01/output.txt b/listings/ch11-writing-automated-tests/listing-11-01/output.txt index 3b09a15ece..fc20e80c9d 100644 --- a/listings/ch11-writing-automated-tests/listing-11-01/output.txt +++ b/listings/ch11-writing-automated-tests/listing-11-01/output.txt @@ -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 (file:///projects/adder/target/debug/deps/adder-7acb243c25ffd9dc) + Running unittests src/lib.rs (target/debug/deps/adder-f533075b22f9175f) running 1 test test tests::it_works ... ok @@ -13,3 +13,4 @@ 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 + diff --git a/listings/ch11-writing-automated-tests/listing-11-03/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-03/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/listing-11-03/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-03/output.txt b/listings/ch11-writing-automated-tests/listing-11-03/output.txt index cf2c206aac..830213172f 100644 --- a/listings/ch11-writing-automated-tests/listing-11-03/output.txt +++ b/listings/ch11-writing-automated-tests/listing-11-03/output.txt @@ -10,6 +10,7 @@ test tests::exploration ... ok failures: ---- tests::another stdout ---- + thread 'tests::another' panicked at src/lib.rs:17:9: Make this test fail note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch11-writing-automated-tests/listing-11-05/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-05/Cargo.toml index 2447c67f51..7693d91073 100644 --- a/listings/ch11-writing-automated-tests/listing-11-05/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangle" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-06/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-06/Cargo.toml index 2447c67f51..7693d91073 100644 --- a/listings/ch11-writing-automated-tests/listing-11-06/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangle" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-07/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-07/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/listing-11-07/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-08/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-08/Cargo.toml index 4e348c8d26..53e7b397ea 100644 --- a/listings/ch11-writing-automated-tests/listing-11-08/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-09/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-09/Cargo.toml index 4e348c8d26..53e7b397ea 100644 --- a/listings/ch11-writing-automated-tests/listing-11-09/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-10/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-10/Cargo.toml index f751864dec..84052beff0 100644 --- a/listings/ch11-writing-automated-tests/listing-11-10/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "silly-function" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-10/output.txt b/listings/ch11-writing-automated-tests/listing-11-10/output.txt index c67b607d8c..6dc3371537 100644 --- a/listings/ch11-writing-automated-tests/listing-11-10/output.txt +++ b/listings/ch11-writing-automated-tests/listing-11-10/output.txt @@ -11,6 +11,7 @@ failures: ---- tests::this_test_will_fail stdout ---- I got the value 8 + thread 'tests::this_test_will_fail' panicked at src/lib.rs:19:9: assertion `left == right` failed left: 10 diff --git a/listings/ch11-writing-automated-tests/listing-11-11/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-11/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/listing-11-11/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-12/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-12/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/listing-11-12/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/listing-11-13/Cargo.toml b/listings/ch11-writing-automated-tests/listing-11-13/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/listing-11-13/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.toml index 2447c67f51..7693d91073 100644 --- a/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-02-adding-another-rectangle-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangle" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.toml index 2447c67f51..7693d91073 100644 --- a/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangle" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt b/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt index 6d616db377..cd0d11a05b 100644 --- a/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt +++ b/listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt @@ -10,6 +10,7 @@ test tests::smaller_cannot_hold_larger ... ok failures: ---- tests::larger_can_hold_smaller stdout ---- + thread 'tests::larger_can_hold_smaller' panicked at src/lib.rs:28:9: assertion failed: larger.can_hold(&smaller) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt b/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt index 927f89144c..ca853f54cd 100644 --- a/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt +++ b/listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt @@ -9,6 +9,7 @@ test tests::it_adds_two ... FAILED failures: ---- tests::it_adds_two stdout ---- + thread 'tests::it_adds_two' panicked at src/lib.rs:12:9: assertion `left == right` failed left: 5 diff --git a/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.toml index 90a826cf43..e1d72850f1 100644 --- a/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-05-greeter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "greeter" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.toml index 90a826cf43..e1d72850f1 100644 --- a/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "greeter" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt b/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt index 0a7d44dce8..4aad2212f6 100644 --- a/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt +++ b/listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt @@ -9,6 +9,7 @@ test tests::greeting_contains_name ... FAILED failures: ---- tests::greeting_contains_name stdout ---- + thread 'tests::greeting_contains_name' panicked at src/lib.rs:12:9: assertion failed: result.contains("Carol") note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.toml index 90a826cf43..e1d72850f1 100644 --- a/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "greeter" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt b/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt index d2015d56b2..ac3044d20e 100644 --- a/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt +++ b/listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt @@ -9,6 +9,7 @@ test tests::greeting_contains_name ... FAILED failures: ---- tests::greeting_contains_name stdout ---- + thread 'tests::greeting_contains_name' panicked at src/lib.rs:12:9: Greeting did not contain name, value was `Hello!` note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.toml index 4e348c8d26..53e7b397ea 100644 --- a/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-08-guess-with-bug/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.toml index 4e348c8d26..53e7b397ea 100644 --- a/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt b/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt index f30b55ab18..51981872a8 100644 --- a/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt +++ b/listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt @@ -9,6 +9,7 @@ test tests::greater_than_100 - should panic ... FAILED failures: ---- tests::greater_than_100 stdout ---- + thread 'tests::greater_than_100' panicked at src/lib.rs:12:13: Guess value must be greater than or equal to 1, got 200. note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.toml b/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.toml +++ b/listings/ch11-writing-automated-tests/no-listing-13-fix-shared-test-code-problem/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.toml b/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.toml index f751864dec..84052beff0 100644 --- a/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.toml +++ b/listings/ch11-writing-automated-tests/output-only-01-show-output/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "silly-function" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt b/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt index b6fa60de53..b541a0dd73 100644 --- a/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt +++ b/listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt @@ -20,6 +20,7 @@ failures: ---- tests::this_test_will_fail stdout ---- I got the value 8 + thread 'tests::this_test_will_fail' panicked at src/lib.rs:19:9: assertion `left == right` failed left: 10 diff --git a/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.toml b/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.toml +++ b/listings/ch11-writing-automated-tests/output-only-02-single-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.toml b/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.toml +++ b/listings/ch11-writing-automated-tests/output-only-03-multiple-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.toml b/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.toml +++ b/listings/ch11-writing-automated-tests/output-only-04-running-ignored/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.toml b/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.toml index e61cb12e3e..9a5826ad47 100644 --- a/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.toml +++ b/listings/ch11-writing-automated-tests/output-only-05-single-integration/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-01/Cargo.toml b/listings/ch12-an-io-project/listing-12-01/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-01/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-02/Cargo.toml b/listings/ch12-an-io-project/listing-12-02/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-02/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-03/Cargo.toml b/listings/ch12-an-io-project/listing-12-03/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-03/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-04/Cargo.toml b/listings/ch12-an-io-project/listing-12-04/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-04/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-05/Cargo.toml b/listings/ch12-an-io-project/listing-12-05/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-05/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-06/Cargo.toml b/listings/ch12-an-io-project/listing-12-06/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-06/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-07/Cargo.toml b/listings/ch12-an-io-project/listing-12-07/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-07/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-07/output.txt b/listings/ch12-an-io-project/listing-12-07/output.txt index e14b954de6..03ce35173d 100644 --- a/listings/ch12-an-io-project/listing-12-07/output.txt +++ b/listings/ch12-an-io-project/listing-12-07/output.txt @@ -2,6 +2,7 @@ $ cargo run Compiling minigrep v0.1.0 (file:///projects/minigrep) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s Running `target/debug/minigrep` + thread 'main' panicked at src/main.rs:27:21: index out of bounds: the len is 1 but the index is 1 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch12-an-io-project/listing-12-08/Cargo.toml b/listings/ch12-an-io-project/listing-12-08/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-08/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-08/output.txt b/listings/ch12-an-io-project/listing-12-08/output.txt index c1aa1a93f9..86174205d5 100644 --- a/listings/ch12-an-io-project/listing-12-08/output.txt +++ b/listings/ch12-an-io-project/listing-12-08/output.txt @@ -2,6 +2,7 @@ $ cargo run Compiling minigrep v0.1.0 (file:///projects/minigrep) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.0s Running `target/debug/minigrep` + thread 'main' panicked at src/main.rs:26:13: not enough arguments note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch12-an-io-project/listing-12-09/Cargo.toml b/listings/ch12-an-io-project/listing-12-09/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-09/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-10/Cargo.toml b/listings/ch12-an-io-project/listing-12-10/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-10/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-11/Cargo.toml b/listings/ch12-an-io-project/listing-12-11/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-11/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-12/Cargo.toml b/listings/ch12-an-io-project/listing-12-12/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-12/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-13/Cargo.toml b/listings/ch12-an-io-project/listing-12-13/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-13/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-14/Cargo.toml b/listings/ch12-an-io-project/listing-12-14/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-14/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-15/Cargo.toml b/listings/ch12-an-io-project/listing-12-15/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-15/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-16/Cargo.toml b/listings/ch12-an-io-project/listing-12-16/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-16/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-16/output.txt b/listings/ch12-an-io-project/listing-12-16/output.txt index 9f4c64d29d..c9c8f74136 100644 --- a/listings/ch12-an-io-project/listing-12-16/output.txt +++ b/listings/ch12-an-io-project/listing-12-16/output.txt @@ -9,6 +9,7 @@ test tests::one_result ... FAILED failures: ---- tests::one_result stdout ---- + thread 'tests::one_result' panicked at src/lib.rs:44:9: assertion `left == right` failed left: ["safe, fast, productive."] diff --git a/listings/ch12-an-io-project/listing-12-17/Cargo.toml b/listings/ch12-an-io-project/listing-12-17/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-17/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-18/Cargo.toml b/listings/ch12-an-io-project/listing-12-18/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-18/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-19/Cargo.toml b/listings/ch12-an-io-project/listing-12-19/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-19/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-20/Cargo.toml b/listings/ch12-an-io-project/listing-12-20/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-20/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-21/Cargo.toml b/listings/ch12-an-io-project/listing-12-21/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-21/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-21/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-22/Cargo.toml b/listings/ch12-an-io-project/listing-12-22/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-22/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-23/Cargo.toml b/listings/ch12-an-io-project/listing-12-23/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-23/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-23/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/listing-12-24/Cargo.toml b/listings/ch12-an-io-project/listing-12-24/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/listing-12-24/Cargo.toml +++ b/listings/ch12-an-io-project/listing-12-24/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.toml b/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.toml +++ b/listings/ch12-an-io-project/no-listing-01-handling-errors-in-main/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.toml b/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.toml +++ b/listings/ch12-an-io-project/no-listing-02-using-search-in-run/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/output-only-01-with-args/Cargo.toml b/listings/ch12-an-io-project/output-only-01-with-args/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/output-only-01-with-args/Cargo.toml +++ b/listings/ch12-an-io-project/output-only-01-with-args/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.toml b/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.toml +++ b/listings/ch12-an-io-project/output-only-02-missing-lifetimes/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.toml b/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.toml +++ b/listings/ch12-an-io-project/output-only-03-multiple-matches/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.toml b/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.toml +++ b/listings/ch12-an-io-project/output-only-04-no-matches/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.toml b/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.toml +++ b/listings/ch13-functional-features/listing-12-23-reproduced/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.toml b/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.toml +++ b/listings/ch13-functional-features/listing-12-24-reproduced/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-01/Cargo.toml b/listings/ch13-functional-features/listing-13-01/Cargo.toml index 1eb392dfaf..4f2229130d 100644 --- a/listings/ch13-functional-features/listing-13-01/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shirt-company" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-02/Cargo.toml b/listings/ch13-functional-features/listing-13-02/Cargo.toml index f09a737d4d..af49cfa92f 100644 --- a/listings/ch13-functional-features/listing-13-02/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "workout-app" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-03/Cargo.toml b/listings/ch13-functional-features/listing-13-03/Cargo.toml index 914c4cfaa8..d2a312ba07 100644 --- a/listings/ch13-functional-features/listing-13-03/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "closure-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-04/Cargo.toml b/listings/ch13-functional-features/listing-13-04/Cargo.toml index 914c4cfaa8..d2a312ba07 100644 --- a/listings/ch13-functional-features/listing-13-04/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "closure-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-04/output.txt b/listings/ch13-functional-features/listing-13-04/output.txt index fbc00b5dfc..fd33cb71fe 100644 --- a/listings/ch13-functional-features/listing-13-04/output.txt +++ b/listings/ch13-functional-features/listing-13-04/output.txt @@ -1,6 +1,4 @@ $ cargo run - Locking 1 package to latest compatible version - Adding closure-example v0.1.0 (/Users/chris/dev/rust-lang/book/tmp/listings/ch13-functional-features/listing-13-04) Compiling closure-example v0.1.0 (file:///projects/closure-example) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s Running `target/debug/closure-example` diff --git a/listings/ch13-functional-features/listing-13-05/Cargo.toml b/listings/ch13-functional-features/listing-13-05/Cargo.toml index 914c4cfaa8..d2a312ba07 100644 --- a/listings/ch13-functional-features/listing-13-05/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "closure-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-05/output.txt b/listings/ch13-functional-features/listing-13-05/output.txt index 695ee4bee3..af22182a18 100644 --- a/listings/ch13-functional-features/listing-13-05/output.txt +++ b/listings/ch13-functional-features/listing-13-05/output.txt @@ -1,6 +1,4 @@ $ cargo run - Locking 1 package to latest compatible version - Adding closure-example v0.1.0 (/Users/chris/dev/rust-lang/book/tmp/listings/ch13-functional-features/listing-13-05) Compiling closure-example v0.1.0 (file:///projects/closure-example) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.43s Running `target/debug/closure-example` diff --git a/listings/ch13-functional-features/listing-13-06/Cargo.toml b/listings/ch13-functional-features/listing-13-06/Cargo.toml index 8085ade0f5..e8f11bd4b5 100644 --- a/listings/ch13-functional-features/listing-13-06/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-06/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "closure-example" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch13-functional-features/listing-13-07/Cargo.toml b/listings/ch13-functional-features/listing-13-07/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch13-functional-features/listing-13-07/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-08/Cargo.toml b/listings/ch13-functional-features/listing-13-08/Cargo.toml index 703c9d9778..2331b52c65 100644 --- a/listings/ch13-functional-features/listing-13-08/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-08/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch13-functional-features/listing-13-09/Cargo.toml b/listings/ch13-functional-features/listing-13-09/Cargo.toml index 4a279a450d..bd5e247b57 100644 --- a/listings/ch13-functional-features/listing-13-09/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rectangles" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-10/Cargo.toml b/listings/ch13-functional-features/listing-13-10/Cargo.toml index 2652a8a1a4..4db0b0f6f1 100644 --- a/listings/ch13-functional-features/listing-13-10/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iterators" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-11/Cargo.toml b/listings/ch13-functional-features/listing-13-11/Cargo.toml index 2652a8a1a4..4db0b0f6f1 100644 --- a/listings/ch13-functional-features/listing-13-11/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iterators" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-12/Cargo.toml b/listings/ch13-functional-features/listing-13-12/Cargo.toml index 2652a8a1a4..4db0b0f6f1 100644 --- a/listings/ch13-functional-features/listing-13-12/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iterators" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-13/Cargo.toml b/listings/ch13-functional-features/listing-13-13/Cargo.toml index 2652a8a1a4..4db0b0f6f1 100644 --- a/listings/ch13-functional-features/listing-13-13/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iterators" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-14/Cargo.toml b/listings/ch13-functional-features/listing-13-14/Cargo.toml index 2652a8a1a4..4db0b0f6f1 100644 --- a/listings/ch13-functional-features/listing-13-14/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iterators" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-15/Cargo.toml b/listings/ch13-functional-features/listing-13-15/Cargo.toml index 2652a8a1a4..4db0b0f6f1 100644 --- a/listings/ch13-functional-features/listing-13-15/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iterators" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-16/Cargo.toml b/listings/ch13-functional-features/listing-13-16/Cargo.toml index cc803776b6..a6b4567302 100644 --- a/listings/ch13-functional-features/listing-13-16/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shoe_size" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-18/Cargo.toml b/listings/ch13-functional-features/listing-13-18/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch13-functional-features/listing-13-18/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-19/Cargo.toml b/listings/ch13-functional-features/listing-13-19/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch13-functional-features/listing-13-19/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-20/Cargo.toml b/listings/ch13-functional-features/listing-13-20/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch13-functional-features/listing-13-20/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch13-functional-features/listing-13-22/Cargo.toml b/listings/ch13-functional-features/listing-13-22/Cargo.toml index 64c2a3f520..b8302aef85 100644 --- a/listings/ch13-functional-features/listing-13-22/Cargo.toml +++ b/listings/ch13-functional-features/listing-13-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minigrep" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/listing-14-01/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-01/Cargo.toml index c52da04129..60664c6887 100644 --- a/listings/ch14-more-about-cargo/listing-14-01/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_crate" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/listing-14-02/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-02/Cargo.toml index c52da04129..60664c6887 100644 --- a/listings/ch14-more-about-cargo/listing-14-02/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "my_crate" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/listing-14-03/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-03/Cargo.toml index 66ef4b532d..f16924bc67 100644 --- a/listings/ch14-more-about-cargo/listing-14-03/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "art" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/listing-14-04/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-04/Cargo.toml index 66ef4b532d..f16924bc67 100644 --- a/listings/ch14-more-about-cargo/listing-14-04/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "art" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/listing-14-05/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-05/Cargo.toml index 66ef4b532d..f16924bc67 100644 --- a/listings/ch14-more-about-cargo/listing-14-05/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "art" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/listing-14-06/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-06/Cargo.toml index 66ef4b532d..f16924bc67 100644 --- a/listings/ch14-more-about-cargo/listing-14-06/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "art" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/listing-14-06/src/main.rs b/listings/ch14-more-about-cargo/listing-14-06/src/main.rs index 51f3b761db..4b6e112afe 100644 --- a/listings/ch14-more-about-cargo/listing-14-06/src/main.rs +++ b/listings/ch14-more-about-cargo/listing-14-06/src/main.rs @@ -1,6 +1,6 @@ // ANCHOR: here -use art::mix; use art::PrimaryColor; +use art::mix; fn main() { // --snip-- diff --git a/listings/ch14-more-about-cargo/listing-14-07/add/add_one/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-07/add/add_one/Cargo.toml index 8af4ab8166..dcfb7f9046 100644 --- a/listings/ch14-more-about-cargo/listing-14-07/add/add_one/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-07/add/add_one/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "add_one" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/listing-14-07/add/adder/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-07/add/adder/Cargo.toml index feb3d956ea..980d5bfc95 100644 --- a/listings/ch14-more-about-cargo/listing-14-07/add/adder/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-07/add/adder/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/Cargo.toml index 8af4ab8166..dcfb7f9046 100644 --- a/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/add_one/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "add_one" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/Cargo.toml index 55c02036c4..5f4a489077 100644 --- a/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/adder/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] add_one = { path = "../add_one" } diff --git a/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/Cargo.toml index bc758bd883..d399d96e7b 100644 --- a/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/add_one/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "add_one" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] rand = "0.8.5" diff --git a/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/Cargo.toml index feb3d956ea..980d5bfc95 100644 --- a/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/adder/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/Cargo.toml index 8af4ab8166..dcfb7f9046 100644 --- a/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/add_one/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "add_one" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/Cargo.toml index feb3d956ea..980d5bfc95 100644 --- a/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/adder/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml b/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml index 8af4ab8166..dcfb7f9046 100644 --- a/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml +++ b/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "add_one" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml b/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml index feb3d956ea..980d5bfc95 100644 --- a/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml +++ b/listings/ch14-more-about-cargo/output-only-02-add-one/add/adder/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/Cargo.toml b/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/Cargo.toml index bc758bd883..d399d96e7b 100644 --- a/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/Cargo.toml +++ b/listings/ch14-more-about-cargo/output-only-03-use-rand/add/add_one/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "add_one" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] rand = "0.8.5" diff --git a/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/Cargo.toml b/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/Cargo.toml index feb3d956ea..980d5bfc95 100644 --- a/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/Cargo.toml +++ b/listings/ch14-more-about-cargo/output-only-03-use-rand/add/adder/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-01/Cargo.toml b/listings/ch15-smart-pointers/listing-15-01/Cargo.toml index 690385c7a4..f645b871de 100644 --- a/listings/ch15-smart-pointers/listing-15-01/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "box-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-02/Cargo.toml b/listings/ch15-smart-pointers/listing-15-02/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-02/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-03/Cargo.toml b/listings/ch15-smart-pointers/listing-15-03/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-03/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-05/Cargo.toml b/listings/ch15-smart-pointers/listing-15-05/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-05/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-06/Cargo.toml b/listings/ch15-smart-pointers/listing-15-06/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/listing-15-06/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-07/Cargo.toml b/listings/ch15-smart-pointers/listing-15-07/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/listing-15-07/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-08/Cargo.toml b/listings/ch15-smart-pointers/listing-15-08/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/listing-15-08/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-09/Cargo.toml b/listings/ch15-smart-pointers/listing-15-09/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/listing-15-09/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-10/Cargo.toml b/listings/ch15-smart-pointers/listing-15-10/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/listing-15-10/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-11/Cargo.toml b/listings/ch15-smart-pointers/listing-15-11/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/listing-15-11/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-12/Cargo.toml b/listings/ch15-smart-pointers/listing-15-12/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/listing-15-12/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-13/Cargo.toml b/listings/ch15-smart-pointers/listing-15-13/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/listing-15-13/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-14/Cargo.toml b/listings/ch15-smart-pointers/listing-15-14/Cargo.toml index 1e4c994815..9b930b59b8 100644 --- a/listings/ch15-smart-pointers/listing-15-14/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "drop-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-15/Cargo.toml b/listings/ch15-smart-pointers/listing-15-15/Cargo.toml index 1e4c994815..9b930b59b8 100644 --- a/listings/ch15-smart-pointers/listing-15-15/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "drop-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-16/Cargo.toml b/listings/ch15-smart-pointers/listing-15-16/Cargo.toml index 1e4c994815..9b930b59b8 100644 --- a/listings/ch15-smart-pointers/listing-15-16/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "drop-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-17/Cargo.toml b/listings/ch15-smart-pointers/listing-15-17/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-17/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-18/Cargo.toml b/listings/ch15-smart-pointers/listing-15-18/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-18/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-19/Cargo.toml b/listings/ch15-smart-pointers/listing-15-19/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-19/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-20/Cargo.toml b/listings/ch15-smart-pointers/listing-15-20/Cargo.toml index 98c3f537c6..f5e2eb12c0 100644 --- a/listings/ch15-smart-pointers/listing-15-20/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "limit-tracker" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-21/Cargo.toml b/listings/ch15-smart-pointers/listing-15-21/Cargo.toml index 98c3f537c6..f5e2eb12c0 100644 --- a/listings/ch15-smart-pointers/listing-15-21/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-21/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "limit-tracker" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-21/output.txt b/listings/ch15-smart-pointers/listing-15-21/output.txt index 8501007f05..7528ad5ac2 100644 --- a/listings/ch15-smart-pointers/listing-15-21/output.txt +++ b/listings/ch15-smart-pointers/listing-15-21/output.txt @@ -17,3 +17,4 @@ help: consider changing this to be a mutable reference in the `impl` method and For more information about this error, try `rustc --explain E0596`. error: could not compile `limit-tracker` (lib test) due to 1 previous error +warning: build failed, waiting for other jobs to finish... diff --git a/listings/ch15-smart-pointers/listing-15-22/Cargo.toml b/listings/ch15-smart-pointers/listing-15-22/Cargo.toml index 98c3f537c6..f5e2eb12c0 100644 --- a/listings/ch15-smart-pointers/listing-15-22/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "limit-tracker" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-23/Cargo.toml b/listings/ch15-smart-pointers/listing-15-23/Cargo.toml index 98c3f537c6..f5e2eb12c0 100644 --- a/listings/ch15-smart-pointers/listing-15-23/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-23/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "limit-tracker" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-23/output.txt b/listings/ch15-smart-pointers/listing-15-23/output.txt index d3e560297c..7beebb3cd8 100644 --- a/listings/ch15-smart-pointers/listing-15-23/output.txt +++ b/listings/ch15-smart-pointers/listing-15-23/output.txt @@ -9,6 +9,7 @@ test tests::it_sends_an_over_75_percent_warning_message ... FAILED failures: ---- tests::it_sends_an_over_75_percent_warning_message stdout ---- + thread 'tests::it_sends_an_over_75_percent_warning_message' panicked at src/lib.rs:60:53: already borrowed: BorrowMutError note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace diff --git a/listings/ch15-smart-pointers/listing-15-24/Cargo.toml b/listings/ch15-smart-pointers/listing-15-24/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-24/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-24/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-25/Cargo.toml b/listings/ch15-smart-pointers/listing-15-25/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-25/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-25/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-26/Cargo.toml b/listings/ch15-smart-pointers/listing-15-26/Cargo.toml index dce1515c3e..d3f10bdeb4 100644 --- a/listings/ch15-smart-pointers/listing-15-26/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-26/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cons-list" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-27/Cargo.toml b/listings/ch15-smart-pointers/listing-15-27/Cargo.toml index 0bbf897d08..72a0e7ceab 100644 --- a/listings/ch15-smart-pointers/listing-15-27/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-27/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tree" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-28/Cargo.toml b/listings/ch15-smart-pointers/listing-15-28/Cargo.toml index 0bbf897d08..72a0e7ceab 100644 --- a/listings/ch15-smart-pointers/listing-15-28/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-28/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tree" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/listing-15-29/Cargo.toml b/listings/ch15-smart-pointers/listing-15-29/Cargo.toml index 0bbf897d08..72a0e7ceab 100644 --- a/listings/ch15-smart-pointers/listing-15-29/Cargo.toml +++ b/listings/ch15-smart-pointers/listing-15-29/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tree" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.toml b/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.toml index 16f92447f6..c172b538f4 100644 --- a/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.toml +++ b/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "borrowing" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.toml b/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.toml index 67ec198f74..bfefa23ee1 100644 --- a/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.toml +++ b/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "deref-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt b/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt index 75ad91a0b3..63eb7959e9 100644 --- a/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt +++ b/listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt @@ -9,7 +9,7 @@ error[E0277]: can't compare `{integer}` with `&{integer}` = help: the trait `PartialEq<&{integer}>` is not implemented for `{integer}` = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider dereferencing here - --> file:///home/.rustup/toolchains/1.82/lib/rustlib/src/rust/library/core/src/macros/mod.rs:46:35 + --> file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/core/src/macros/mod.rs:46:35 | 46| if !(*left_val == **right_val) { | + diff --git a/listings/ch16-fearless-concurrency/listing-16-01/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-01/Cargo.toml index bd4edf7626..f210198185 100644 --- a/listings/ch16-fearless-concurrency/listing-16-01/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "threads" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-02/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-02/Cargo.toml index bd4edf7626..f210198185 100644 --- a/listings/ch16-fearless-concurrency/listing-16-02/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "threads" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-03/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-03/Cargo.toml index bd4edf7626..f210198185 100644 --- a/listings/ch16-fearless-concurrency/listing-16-03/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "threads" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-04/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-04/Cargo.toml index bd4edf7626..f210198185 100644 --- a/listings/ch16-fearless-concurrency/listing-16-04/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "threads" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-05/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-05/Cargo.toml index bd4edf7626..f210198185 100644 --- a/listings/ch16-fearless-concurrency/listing-16-05/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "threads" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-06/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-06/Cargo.toml index 24bd2ee7b4..4bf22a497f 100644 --- a/listings/ch16-fearless-concurrency/listing-16-06/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "message-passing" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-07/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-07/Cargo.toml index 24bd2ee7b4..4bf22a497f 100644 --- a/listings/ch16-fearless-concurrency/listing-16-07/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "message-passing" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-08/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-08/Cargo.toml index 24bd2ee7b4..4bf22a497f 100644 --- a/listings/ch16-fearless-concurrency/listing-16-08/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "message-passing" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-09/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-09/Cargo.toml index 24bd2ee7b4..4bf22a497f 100644 --- a/listings/ch16-fearless-concurrency/listing-16-09/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "message-passing" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-10/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-10/Cargo.toml index 24bd2ee7b4..4bf22a497f 100644 --- a/listings/ch16-fearless-concurrency/listing-16-10/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "message-passing" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-11/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-11/Cargo.toml index 24bd2ee7b4..4bf22a497f 100644 --- a/listings/ch16-fearless-concurrency/listing-16-11/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "message-passing" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-12/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-12/Cargo.toml index da297eaba1..e77784295e 100644 --- a/listings/ch16-fearless-concurrency/listing-16-12/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shared-state" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-13/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-13/Cargo.toml index da297eaba1..e77784295e 100644 --- a/listings/ch16-fearless-concurrency/listing-16-13/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shared-state" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-14/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-14/Cargo.toml index da297eaba1..e77784295e 100644 --- a/listings/ch16-fearless-concurrency/listing-16-14/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shared-state" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/listing-16-14/output.txt b/listings/ch16-fearless-concurrency/listing-16-14/output.txt index a0adbc6190..486a064174 100644 --- a/listings/ch16-fearless-concurrency/listing-16-14/output.txt +++ b/listings/ch16-fearless-concurrency/listing-16-14/output.txt @@ -15,19 +15,19 @@ error[E0277]: `Rc>` cannot be sent between threads safely 15 | | }); | |_________^ `Rc>` cannot be sent between threads safely | - = help: within `{closure@src/main.rs:11:36: 11:43}`, the trait `Send` is not implemented for `Rc>`, which is required by `{closure@src/main.rs:11:36: 11:43}: Send` + = help: within `{closure@src/main.rs:11:36: 11:43}`, the trait `Send` is not implemented for `Rc>` note: required because it's used within this closure --> src/main.rs:11:36 | 11 | let handle = thread::spawn(move || { | ^^^^^^^ note: required by a bound in `spawn` - --> file:///home/.rustup/toolchains/1.82/lib/rustlib/src/rust/library/std/src/thread/mod.rs:675:8 + --> file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/std/src/thread/mod.rs:731:8 | -672 | pub fn spawn(f: F) -> JoinHandle +728 | pub fn spawn(f: F) -> JoinHandle | ----- required by a bound in this function ... -675 | F: Send + 'static, +731 | F: Send + 'static, | ^^^^ required by this bound in `spawn` For more information about this error, try `rustc --explain E0277`. diff --git a/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml index da297eaba1..e77784295e 100644 --- a/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml +++ b/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shared-state" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.toml b/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.toml index bd4edf7626..f210198185 100644 --- a/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.toml +++ b/listings/ch16-fearless-concurrency/no-listing-01-join-too-early/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "threads" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.toml b/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.toml index da297eaba1..e77784295e 100644 --- a/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.toml +++ b/listings/ch16-fearless-concurrency/no-listing-02-no-loop-to-understand-error/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shared-state" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.toml b/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.toml index bd4edf7626..f210198185 100644 --- a/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.toml +++ b/listings/ch16-fearless-concurrency/output-only-01-move-drop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "threads" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch17-async-await/listing-17-01/Cargo.toml b/listings/ch17-async-await/listing-17-01/Cargo.toml index 57fe49bfe5..6155f0fa64 100644 --- a/listings/ch17-async-await/listing-17-01/Cargo.toml +++ b/listings/ch17-async-await/listing-17-01/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] trpl = { path = "../../../packages/trpl" } diff --git a/listings/ch17-async-await/listing-17-02/Cargo.toml b/listings/ch17-async-await/listing-17-02/Cargo.toml index 57fe49bfe5..6155f0fa64 100644 --- a/listings/ch17-async-await/listing-17-02/Cargo.toml +++ b/listings/ch17-async-await/listing-17-02/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] trpl = { path = "../../../packages/trpl" } diff --git a/listings/ch17-async-await/listing-17-03/Cargo.toml b/listings/ch17-async-await/listing-17-03/Cargo.toml index 57fe49bfe5..6155f0fa64 100644 --- a/listings/ch17-async-await/listing-17-03/Cargo.toml +++ b/listings/ch17-async-await/listing-17-03/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] trpl = { path = "../../../packages/trpl" } diff --git a/listings/ch17-async-await/listing-17-04/Cargo.toml b/listings/ch17-async-await/listing-17-04/Cargo.toml index 57fe49bfe5..6155f0fa64 100644 --- a/listings/ch17-async-await/listing-17-04/Cargo.toml +++ b/listings/ch17-async-await/listing-17-04/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] trpl = { path = "../../../packages/trpl" } diff --git a/listings/ch17-async-await/listing-17-05/Cargo.toml b/listings/ch17-async-await/listing-17-05/Cargo.toml index 57fe49bfe5..6155f0fa64 100644 --- a/listings/ch17-async-await/listing-17-05/Cargo.toml +++ b/listings/ch17-async-await/listing-17-05/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] trpl = { path = "../../../packages/trpl" } diff --git a/listings/ch17-async-await/listing-17-06/Cargo.toml b/listings/ch17-async-await/listing-17-06/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-06/Cargo.toml +++ b/listings/ch17-async-await/listing-17-06/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-07/Cargo.toml b/listings/ch17-async-await/listing-17-07/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-07/Cargo.toml +++ b/listings/ch17-async-await/listing-17-07/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-08/Cargo.toml b/listings/ch17-async-await/listing-17-08/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-08/Cargo.toml +++ b/listings/ch17-async-await/listing-17-08/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-09/Cargo.toml b/listings/ch17-async-await/listing-17-09/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-09/Cargo.toml +++ b/listings/ch17-async-await/listing-17-09/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-10/Cargo.toml b/listings/ch17-async-await/listing-17-10/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-10/Cargo.toml +++ b/listings/ch17-async-await/listing-17-10/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-11/Cargo.toml b/listings/ch17-async-await/listing-17-11/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-11/Cargo.toml +++ b/listings/ch17-async-await/listing-17-11/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-12/Cargo.toml b/listings/ch17-async-await/listing-17-12/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-12/Cargo.toml +++ b/listings/ch17-async-await/listing-17-12/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-13/Cargo.toml b/listings/ch17-async-await/listing-17-13/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-13/Cargo.toml +++ b/listings/ch17-async-await/listing-17-13/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-14/Cargo.toml b/listings/ch17-async-await/listing-17-14/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-14/Cargo.toml +++ b/listings/ch17-async-await/listing-17-14/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-15/Cargo.toml b/listings/ch17-async-await/listing-17-15/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-15/Cargo.toml +++ b/listings/ch17-async-await/listing-17-15/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-16/Cargo.toml b/listings/ch17-async-await/listing-17-16/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-16/Cargo.toml +++ b/listings/ch17-async-await/listing-17-16/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-17/Cargo.toml b/listings/ch17-async-await/listing-17-17/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-17/Cargo.toml +++ b/listings/ch17-async-await/listing-17-17/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-18/Cargo.toml b/listings/ch17-async-await/listing-17-18/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-18/Cargo.toml +++ b/listings/ch17-async-await/listing-17-18/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-18/src/main.rs b/listings/ch17-async-await/listing-17-18/src/main.rs index 7773660519..a55762831d 100644 --- a/listings/ch17-async-await/listing-17-18/src/main.rs +++ b/listings/ch17-async-await/listing-17-18/src/main.rs @@ -2,7 +2,7 @@ extern crate trpl; // required for mdbook test use std::{ future::Future, - pin::{pin, Pin}, + pin::{Pin, pin}, time::Duration, }; diff --git a/listings/ch17-async-await/listing-17-19/Cargo.toml b/listings/ch17-async-await/listing-17-19/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-19/Cargo.toml +++ b/listings/ch17-async-await/listing-17-19/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-19/src/main.rs b/listings/ch17-async-await/listing-17-19/src/main.rs index 41820fc8a5..9378d7d723 100644 --- a/listings/ch17-async-await/listing-17-19/src/main.rs +++ b/listings/ch17-async-await/listing-17-19/src/main.rs @@ -2,7 +2,7 @@ extern crate trpl; // required for mdbook test use std::{ future::Future, - pin::{pin, Pin}, + pin::{Pin, pin}, time::Duration, }; diff --git a/listings/ch17-async-await/listing-17-20/Cargo.toml b/listings/ch17-async-await/listing-17-20/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-20/Cargo.toml +++ b/listings/ch17-async-await/listing-17-20/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-21/Cargo.toml b/listings/ch17-async-await/listing-17-21/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-21/Cargo.toml +++ b/listings/ch17-async-await/listing-17-21/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-22/Cargo.toml b/listings/ch17-async-await/listing-17-22/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-22/Cargo.toml +++ b/listings/ch17-async-await/listing-17-22/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-23/Cargo.toml b/listings/ch17-async-await/listing-17-23/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-23/Cargo.toml +++ b/listings/ch17-async-await/listing-17-23/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-24/Cargo.toml b/listings/ch17-async-await/listing-17-24/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-24/Cargo.toml +++ b/listings/ch17-async-await/listing-17-24/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-25/Cargo.toml b/listings/ch17-async-await/listing-17-25/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-25/Cargo.toml +++ b/listings/ch17-async-await/listing-17-25/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-26/Cargo.toml b/listings/ch17-async-await/listing-17-26/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-26/Cargo.toml +++ b/listings/ch17-async-await/listing-17-26/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-27/Cargo.toml b/listings/ch17-async-await/listing-17-27/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-27/Cargo.toml +++ b/listings/ch17-async-await/listing-17-27/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-28/Cargo.toml b/listings/ch17-async-await/listing-17-28/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-28/Cargo.toml +++ b/listings/ch17-async-await/listing-17-28/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-29/Cargo.toml b/listings/ch17-async-await/listing-17-29/Cargo.toml index 349041d3eb..10702bd9f5 100644 --- a/listings/ch17-async-await/listing-17-29/Cargo.toml +++ b/listings/ch17-async-await/listing-17-29/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch17-async-await/listing-17-30/Cargo.toml b/listings/ch17-async-await/listing-17-30/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-30/Cargo.toml +++ b/listings/ch17-async-await/listing-17-30/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-31/Cargo.toml b/listings/ch17-async-await/listing-17-31/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-31/Cargo.toml +++ b/listings/ch17-async-await/listing-17-31/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-32/Cargo.toml b/listings/ch17-async-await/listing-17-32/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-32/Cargo.toml +++ b/listings/ch17-async-await/listing-17-32/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-33/Cargo.toml b/listings/ch17-async-await/listing-17-33/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-33/Cargo.toml +++ b/listings/ch17-async-await/listing-17-33/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-34/Cargo.toml b/listings/ch17-async-await/listing-17-34/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-34/Cargo.toml +++ b/listings/ch17-async-await/listing-17-34/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-35/Cargo.toml b/listings/ch17-async-await/listing-17-35/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-35/Cargo.toml +++ b/listings/ch17-async-await/listing-17-35/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-36/Cargo.toml b/listings/ch17-async-await/listing-17-36/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-36/Cargo.toml +++ b/listings/ch17-async-await/listing-17-36/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-37/Cargo.toml b/listings/ch17-async-await/listing-17-37/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-37/Cargo.toml +++ b/listings/ch17-async-await/listing-17-37/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-38/Cargo.toml b/listings/ch17-async-await/listing-17-38/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-38/Cargo.toml +++ b/listings/ch17-async-await/listing-17-38/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-39/Cargo.toml b/listings/ch17-async-await/listing-17-39/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-39/Cargo.toml +++ b/listings/ch17-async-await/listing-17-39/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-40/Cargo.toml b/listings/ch17-async-await/listing-17-40/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-40/Cargo.toml +++ b/listings/ch17-async-await/listing-17-40/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-41/Cargo.toml b/listings/ch17-async-await/listing-17-41/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-41/Cargo.toml +++ b/listings/ch17-async-await/listing-17-41/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/listing-17-42/Cargo.toml b/listings/ch17-async-await/listing-17-42/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/listing-17-42/Cargo.toml +++ b/listings/ch17-async-await/listing-17-42/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/no-listing-state-machine/Cargo.toml b/listings/ch17-async-await/no-listing-state-machine/Cargo.toml index e094f067f1..e5c8a84843 100644 --- a/listings/ch17-async-await/no-listing-state-machine/Cargo.toml +++ b/listings/ch17-async-await/no-listing-state-machine/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/listings/ch17-async-await/no-listing-stream-ext/Cargo.toml b/listings/ch17-async-await/no-listing-stream-ext/Cargo.toml index 67729afc80..12171e3621 100644 --- a/listings/ch17-async-await/no-listing-stream-ext/Cargo.toml +++ b/listings/ch17-async-await/no-listing-stream-ext/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "async_await" version = "0.1.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/listings/ch18-oop/listing-18-01/Cargo.toml b/listings/ch18-oop/listing-18-01/Cargo.toml index aed614e939..af2ec971d9 100644 --- a/listings/ch18-oop/listing-18-01/Cargo.toml +++ b/listings/ch18-oop/listing-18-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "averaged-collection" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-02/Cargo.toml b/listings/ch18-oop/listing-18-02/Cargo.toml index aed614e939..af2ec971d9 100644 --- a/listings/ch18-oop/listing-18-02/Cargo.toml +++ b/listings/ch18-oop/listing-18-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "averaged-collection" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-03/Cargo.toml b/listings/ch18-oop/listing-18-03/Cargo.toml index 9b816e7661..ac8282d685 100644 --- a/listings/ch18-oop/listing-18-03/Cargo.toml +++ b/listings/ch18-oop/listing-18-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gui" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-04/Cargo.toml b/listings/ch18-oop/listing-18-04/Cargo.toml index 9b816e7661..ac8282d685 100644 --- a/listings/ch18-oop/listing-18-04/Cargo.toml +++ b/listings/ch18-oop/listing-18-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gui" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-05/Cargo.toml b/listings/ch18-oop/listing-18-05/Cargo.toml index 9b816e7661..ac8282d685 100644 --- a/listings/ch18-oop/listing-18-05/Cargo.toml +++ b/listings/ch18-oop/listing-18-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gui" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-06/Cargo.toml b/listings/ch18-oop/listing-18-06/Cargo.toml index 9b816e7661..ac8282d685 100644 --- a/listings/ch18-oop/listing-18-06/Cargo.toml +++ b/listings/ch18-oop/listing-18-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gui" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-07/Cargo.toml b/listings/ch18-oop/listing-18-07/Cargo.toml index 9b816e7661..ac8282d685 100644 --- a/listings/ch18-oop/listing-18-07/Cargo.toml +++ b/listings/ch18-oop/listing-18-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gui" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-08/Cargo.toml b/listings/ch18-oop/listing-18-08/Cargo.toml index 9b816e7661..ac8282d685 100644 --- a/listings/ch18-oop/listing-18-08/Cargo.toml +++ b/listings/ch18-oop/listing-18-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gui" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-09/Cargo.toml b/listings/ch18-oop/listing-18-09/Cargo.toml index 9b816e7661..ac8282d685 100644 --- a/listings/ch18-oop/listing-18-09/Cargo.toml +++ b/listings/ch18-oop/listing-18-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gui" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-10/Cargo.toml b/listings/ch18-oop/listing-18-10/Cargo.toml index 9b816e7661..ac8282d685 100644 --- a/listings/ch18-oop/listing-18-10/Cargo.toml +++ b/listings/ch18-oop/listing-18-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gui" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-11/Cargo.toml b/listings/ch18-oop/listing-18-11/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-11/Cargo.toml +++ b/listings/ch18-oop/listing-18-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-12/Cargo.toml b/listings/ch18-oop/listing-18-12/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-12/Cargo.toml +++ b/listings/ch18-oop/listing-18-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-13/Cargo.toml b/listings/ch18-oop/listing-18-13/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-13/Cargo.toml +++ b/listings/ch18-oop/listing-18-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-14/Cargo.toml b/listings/ch18-oop/listing-18-14/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-14/Cargo.toml +++ b/listings/ch18-oop/listing-18-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-15/Cargo.toml b/listings/ch18-oop/listing-18-15/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-15/Cargo.toml +++ b/listings/ch18-oop/listing-18-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-16/Cargo.toml b/listings/ch18-oop/listing-18-16/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-16/Cargo.toml +++ b/listings/ch18-oop/listing-18-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-17/Cargo.toml b/listings/ch18-oop/listing-18-17/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-17/Cargo.toml +++ b/listings/ch18-oop/listing-18-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-18/Cargo.toml b/listings/ch18-oop/listing-18-18/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-18/Cargo.toml +++ b/listings/ch18-oop/listing-18-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-19/Cargo.toml b/listings/ch18-oop/listing-18-19/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-19/Cargo.toml +++ b/listings/ch18-oop/listing-18-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-20/Cargo.toml b/listings/ch18-oop/listing-18-20/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-20/Cargo.toml +++ b/listings/ch18-oop/listing-18-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch18-oop/listing-18-21/Cargo.toml b/listings/ch18-oop/listing-18-21/Cargo.toml index 1619af5c64..790832e0a9 100644 --- a/listings/ch18-oop/listing-18-21/Cargo.toml +++ b/listings/ch18-oop/listing-18-21/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blog" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-01/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-01/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-01/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-02/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-02/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-02/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-03/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-03/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-03/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-04/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-04/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-04/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-05/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-05/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-05/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-06/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-06/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-06/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-07/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-07/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-07/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-08/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-08/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-08/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-08/output.txt b/listings/ch19-patterns-and-matching/listing-19-08/output.txt index 6ce3dfc582..0ed34b7164 100644 --- a/listings/ch19-patterns-and-matching/listing-19-08/output.txt +++ b/listings/ch19-patterns-and-matching/listing-19-08/output.txt @@ -7,7 +7,7 @@ error[E0005]: refutable pattern in local binding | ^^^^^^^ pattern `None` not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html + = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html = note: the matched value is of type `Option` help: you might want to use `let else` to handle the variant that isn't matched | diff --git a/listings/ch19-patterns-and-matching/listing-19-09/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-09/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-09/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-10/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-10/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-10/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-11/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-11/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-11/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-12/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-12/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-12/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-13/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-13/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-13/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-14/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-14/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-14/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-15/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-15/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-15/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-16/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-16/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-16/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-17/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-17/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-17/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-18/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-18/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-18/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-19/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-19/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-19/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-20/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-20/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-20/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-21/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-21/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-21/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-21/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-22/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-22/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-22/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-23/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-23/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-23/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-23/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-24/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-24/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-24/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-24/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-25/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-25/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-25/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-25/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-26/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-26/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-26/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-26/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-27/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-27/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-27/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-27/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-28/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-28/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-28/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-28/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/listing-19-29/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-29/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/listing-19-29/Cargo.toml +++ b/listings/ch19-patterns-and-matching/listing-19-29/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/no-listing-01-literals/Cargo.toml b/listings/ch19-patterns-and-matching/no-listing-01-literals/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/no-listing-01-literals/Cargo.toml +++ b/listings/ch19-patterns-and-matching/no-listing-01-literals/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.toml b/listings/ch19-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.toml +++ b/listings/ch19-patterns-and-matching/no-listing-02-multiple-patterns/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/no-listing-03-ranges/Cargo.toml b/listings/ch19-patterns-and-matching/no-listing-03-ranges/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/no-listing-03-ranges/Cargo.toml +++ b/listings/ch19-patterns-and-matching/no-listing-03-ranges/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.toml b/listings/ch19-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.toml +++ b/listings/ch19-patterns-and-matching/no-listing-04-ranges-of-char/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch19-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.toml b/listings/ch19-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.toml index 82fe057bbc..7e3247669f 100644 --- a/listings/ch19-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.toml +++ b/listings/ch19-patterns-and-matching/no-listing-05-destructuring-structs-and-tuples/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "patterns" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-01/Cargo.toml b/listings/ch20-advanced-features/listing-20-01/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-01/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-02/Cargo.toml b/listings/ch20-advanced-features/listing-20-02/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-02/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-03/Cargo.toml b/listings/ch20-advanced-features/listing-20-03/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-03/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-04/Cargo.toml b/listings/ch20-advanced-features/listing-20-04/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-04/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-04/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-05/Cargo.toml b/listings/ch20-advanced-features/listing-20-05/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-05/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-06/Cargo.toml b/listings/ch20-advanced-features/listing-20-06/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-06/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-07/Cargo.toml b/listings/ch20-advanced-features/listing-20-07/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-07/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-08/Cargo.toml b/listings/ch20-advanced-features/listing-20-08/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-08/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-08/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-09/Cargo.toml b/listings/ch20-advanced-features/listing-20-09/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-09/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-10/Cargo.toml b/listings/ch20-advanced-features/listing-20-10/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-10/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-11/Cargo.toml b/listings/ch20-advanced-features/listing-20-11/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-11/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-11/output.txt b/listings/ch20-advanced-features/listing-20-11/output.txt index abddb73627..d9b4301028 100644 --- a/listings/ch20-advanced-features/listing-20-11/output.txt +++ b/listings/ch20-advanced-features/listing-20-11/output.txt @@ -2,14 +2,4 @@ $ cargo +nightly miri run Compiling unsafe-example v0.1.0 (file:///projects/unsafe-example) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s Running `/Users/chris/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo-miri runner target/miri/aarch64-apple-darwin/debug/unsafe-example` -warning: creating a shared reference to mutable static is discouraged - --> src/main.rs:14:33 - | -14 | println!("COUNTER: {}", COUNTER); - | ^^^^^^^ shared reference to mutable static - | - = note: for more information, see - = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives - = note: `#[warn(static_mut_refs)]` on by default - COUNTER: 3 diff --git a/listings/ch20-advanced-features/listing-20-12/Cargo.toml b/listings/ch20-advanced-features/listing-20-12/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/listing-20-12/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-13/Cargo.toml b/listings/ch20-advanced-features/listing-20-13/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-13/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-14/Cargo.toml b/listings/ch20-advanced-features/listing-20-14/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-14/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-15/Cargo.toml b/listings/ch20-advanced-features/listing-20-15/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-15/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-16/Cargo.toml b/listings/ch20-advanced-features/listing-20-16/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-16/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-17/Cargo.toml b/listings/ch20-advanced-features/listing-20-17/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-17/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-18/Cargo.toml b/listings/ch20-advanced-features/listing-20-18/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-18/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-19/Cargo.toml b/listings/ch20-advanced-features/listing-20-19/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-19/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-20/Cargo.toml b/listings/ch20-advanced-features/listing-20-20/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-20/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-21/Cargo.toml b/listings/ch20-advanced-features/listing-20-21/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-21/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-21/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-22/Cargo.toml b/listings/ch20-advanced-features/listing-20-22/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-22/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-23/Cargo.toml b/listings/ch20-advanced-features/listing-20-23/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-23/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-23/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-24/Cargo.toml b/listings/ch20-advanced-features/listing-20-24/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/listing-20-24/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-24/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-25/Cargo.toml b/listings/ch20-advanced-features/listing-20-25/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/listing-20-25/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-25/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-26/Cargo.toml b/listings/ch20-advanced-features/listing-20-26/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/listing-20-26/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-26/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-28/Cargo.toml b/listings/ch20-advanced-features/listing-20-28/Cargo.toml index b196f35b55..3644460993 100644 --- a/listings/ch20-advanced-features/listing-20-28/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-28/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-29/Cargo.toml b/listings/ch20-advanced-features/listing-20-29/Cargo.toml index 9218091c89..76689ec01b 100644 --- a/listings/ch20-advanced-features/listing-20-29/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-29/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "macros-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-31/Cargo.toml b/listings/ch20-advanced-features/listing-20-31/Cargo.toml index c6fb920877..aaaf3bf827 100644 --- a/listings/ch20-advanced-features/listing-20-31/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-31/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello_macro" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-32/hello_macro/Cargo.toml b/listings/ch20-advanced-features/listing-20-32/hello_macro/Cargo.toml index c6fb920877..aaaf3bf827 100644 --- a/listings/ch20-advanced-features/listing-20-32/hello_macro/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-32/hello_macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello_macro" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-32/hello_macro/hello_macro_derive/Cargo.toml b/listings/ch20-advanced-features/listing-20-32/hello_macro/hello_macro_derive/Cargo.toml index ed9e917ad0..8e54d81ade 100644 --- a/listings/ch20-advanced-features/listing-20-32/hello_macro/hello_macro_derive/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-32/hello_macro/hello_macro_derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "hello_macro_derive" version = "0.1.0" -edition = "2021" +edition = "2024" [lib] proc-macro = true diff --git a/listings/ch20-advanced-features/listing-20-34/hello_macro/Cargo.toml b/listings/ch20-advanced-features/listing-20-34/hello_macro/Cargo.toml index c6fb920877..aaaf3bf827 100644 --- a/listings/ch20-advanced-features/listing-20-34/hello_macro/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-34/hello_macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello_macro" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-34/hello_macro/hello_macro_derive/Cargo.toml b/listings/ch20-advanced-features/listing-20-34/hello_macro/hello_macro_derive/Cargo.toml index ed9e917ad0..8e54d81ade 100644 --- a/listings/ch20-advanced-features/listing-20-34/hello_macro/hello_macro_derive/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-34/hello_macro/hello_macro_derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "hello_macro_derive" version = "0.1.0" -edition = "2021" +edition = "2024" [lib] proc-macro = true diff --git a/listings/ch20-advanced-features/listing-20-34/hello_macro/hello_macro_derive/src/lib.rs b/listings/ch20-advanced-features/listing-20-34/hello_macro/hello_macro_derive/src/lib.rs index ba1215f510..bba8ffba47 100644 --- a/listings/ch20-advanced-features/listing-20-34/hello_macro/hello_macro_derive/src/lib.rs +++ b/listings/ch20-advanced-features/listing-20-34/hello_macro/hello_macro_derive/src/lib.rs @@ -14,13 +14,13 @@ pub fn hello_macro_derive(input: TokenStream) -> TokenStream { // ANCHOR: here fn impl_hello_macro(ast: &syn::DeriveInput) -> TokenStream { let name = &ast.ident; - let gen = quote! { + let generated = quote! { impl HelloMacro for #name { fn hello_macro() { println!("Hello, Macro! My name is {}!", stringify!(#name)); } } }; - gen.into() + generated.into() } // ANCHOR_END: here diff --git a/listings/ch20-advanced-features/no-listing-01-unsafe-fn/Cargo.toml b/listings/ch20-advanced-features/no-listing-01-unsafe-fn/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/no-listing-01-unsafe-fn/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-01-unsafe-fn/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.toml b/listings/ch20-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-02-impl-outlineprint-for-point/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-03-impl-display-for-point/Cargo.toml b/listings/ch20-advanced-features/no-listing-03-impl-display-for-point/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/no-listing-03-impl-display-for-point/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-03-impl-display-for-point/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-04-kilometers-alias/Cargo.toml b/listings/ch20-advanced-features/no-listing-04-kilometers-alias/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/no-listing-04-kilometers-alias/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-04-kilometers-alias/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-05-write-trait/Cargo.toml b/listings/ch20-advanced-features/no-listing-05-write-trait/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/no-listing-05-write-trait/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-05-write-trait/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-06-result-alias/Cargo.toml b/listings/ch20-advanced-features/no-listing-06-result-alias/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/no-listing-06-result-alias/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-06-result-alias/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-07-never-type/Cargo.toml b/listings/ch20-advanced-features/no-listing-07-never-type/Cargo.toml index 52395a5873..9c48a44e57 100644 --- a/listings/ch20-advanced-features/no-listing-07-never-type/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-07-never-type/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-08-match-arms-different-types/Cargo.toml b/listings/ch20-advanced-features/no-listing-08-match-arms-different-types/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/no-listing-08-match-arms-different-types/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-08-match-arms-different-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-09-unwrap-definition/Cargo.toml b/listings/ch20-advanced-features/no-listing-09-unwrap-definition/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/no-listing-09-unwrap-definition/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-09-unwrap-definition/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-10-loop-returns-never/Cargo.toml b/listings/ch20-advanced-features/no-listing-10-loop-returns-never/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/no-listing-10-loop-returns-never/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-10-loop-returns-never/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-11-cant-create-str/Cargo.toml b/listings/ch20-advanced-features/no-listing-11-cant-create-str/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/no-listing-11-cant-create-str/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-11-cant-create-str/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-12-generic-fn-definition/Cargo.toml b/listings/ch20-advanced-features/no-listing-12-generic-fn-definition/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/no-listing-12-generic-fn-definition/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-12-generic-fn-definition/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.toml b/listings/ch20-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-13-generic-implicit-sized-bound/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-14-generic-maybe-sized/Cargo.toml b/listings/ch20-advanced-features/no-listing-14-generic-maybe-sized/Cargo.toml index a2ae20c77c..9884d38311 100644 --- a/listings/ch20-advanced-features/no-listing-14-generic-maybe-sized/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-14-generic-maybe-sized/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "types-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.toml b/listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.toml index b196f35b55..3644460993 100644 --- a/listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-16-map-function/Cargo.toml b/listings/ch20-advanced-features/no-listing-16-map-function/Cargo.toml index b196f35b55..3644460993 100644 --- a/listings/ch20-advanced-features/no-listing-16-map-function/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-16-map-function/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.toml b/listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.toml index b196f35b55..3644460993 100644 --- a/listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-18-returns-closure/Cargo.toml b/listings/ch20-advanced-features/no-listing-18-returns-closure/Cargo.toml index b196f35b55..3644460993 100644 --- a/listings/ch20-advanced-features/no-listing-18-returns-closure/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-18-returns-closure/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.toml b/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.toml index b196f35b55..3644460993 100644 --- a/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "functions-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml b/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml index c6fb920877..aaaf3bf827 100644 --- a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello_macro" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml b/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml index 3ad910862a..faee67fcde 100644 --- a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pancakes" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] hello_macro = { path = "../hello_macro" } \ No newline at end of file diff --git a/listings/ch20-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.toml b/listings/ch20-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.toml index c6fb920877..aaaf3bf827 100644 --- a/listings/ch20-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-21-pancakes/hello_macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello_macro" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.toml b/listings/ch20-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.toml index ed9e917ad0..8e54d81ade 100644 --- a/listings/ch20-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-21-pancakes/hello_macro/hello_macro_derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "hello_macro_derive" version = "0.1.0" -edition = "2021" +edition = "2024" [lib] proc-macro = true diff --git a/listings/ch20-advanced-features/no-listing-21-pancakes/pancakes/Cargo.toml b/listings/ch20-advanced-features/no-listing-21-pancakes/pancakes/Cargo.toml index cb3a98c3a8..2b1b36cd28 100644 --- a/listings/ch20-advanced-features/no-listing-21-pancakes/pancakes/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-21-pancakes/pancakes/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "pancakes" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] hello_macro = { path = "../hello_macro" } diff --git a/listings/ch20-advanced-features/no-listing-22-iterator-on-counter/Cargo.toml b/listings/ch20-advanced-features/no-listing-22-iterator-on-counter/Cargo.toml index 9e103f3eb3..2096415b85 100644 --- a/listings/ch20-advanced-features/no-listing-22-iterator-on-counter/Cargo.toml +++ b/listings/ch20-advanced-features/no-listing-22-iterator-on-counter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "counter" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/output-only-01-missing-unsafe/Cargo.toml b/listings/ch20-advanced-features/output-only-01-missing-unsafe/Cargo.toml index 3e8a292013..690cfbdd4d 100644 --- a/listings/ch20-advanced-features/output-only-01-missing-unsafe/Cargo.toml +++ b/listings/ch20-advanced-features/output-only-01-missing-unsafe/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/output-only-01-missing-unsafe/output.txt b/listings/ch20-advanced-features/output-only-01-missing-unsafe/output.txt index b14994cdd1..f85a4d3c1f 100644 --- a/listings/ch20-advanced-features/output-only-01-missing-unsafe/output.txt +++ b/listings/ch20-advanced-features/output-only-01-missing-unsafe/output.txt @@ -1,6 +1,6 @@ $ cargo run Compiling unsafe-example v0.1.0 (file:///projects/unsafe-example) -error[E0133]: call to unsafe function `dangerous` is unsafe and requires unsafe function or block +error[E0133]: call to unsafe function `dangerous` is unsafe and requires unsafe block --> src/main.rs:4:5 | 4 | dangerous(); diff --git a/listings/ch21-web-server/listing-21-01/Cargo.toml b/listings/ch21-web-server/listing-21-01/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-01/Cargo.toml +++ b/listings/ch21-web-server/listing-21-01/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-02/Cargo.toml b/listings/ch21-web-server/listing-21-02/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-02/Cargo.toml +++ b/listings/ch21-web-server/listing-21-02/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-02/src/main.rs b/listings/ch21-web-server/listing-21-02/src/main.rs index 1eff2eef3a..fe31142615 100644 --- a/listings/ch21-web-server/listing-21-02/src/main.rs +++ b/listings/ch21-web-server/listing-21-02/src/main.rs @@ -1,5 +1,5 @@ use std::{ - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, }; diff --git a/listings/ch21-web-server/listing-21-03/Cargo.toml b/listings/ch21-web-server/listing-21-03/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-03/Cargo.toml +++ b/listings/ch21-web-server/listing-21-03/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-03/src/main.rs b/listings/ch21-web-server/listing-21-03/src/main.rs index 17c8401d4d..52e586ac64 100644 --- a/listings/ch21-web-server/listing-21-03/src/main.rs +++ b/listings/ch21-web-server/listing-21-03/src/main.rs @@ -1,5 +1,5 @@ use std::{ - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, }; diff --git a/listings/ch21-web-server/listing-21-05/Cargo.toml b/listings/ch21-web-server/listing-21-05/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-05/Cargo.toml +++ b/listings/ch21-web-server/listing-21-05/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-05/src/main.rs b/listings/ch21-web-server/listing-21-05/src/main.rs index 437d9b626e..25fc312d54 100644 --- a/listings/ch21-web-server/listing-21-05/src/main.rs +++ b/listings/ch21-web-server/listing-21-05/src/main.rs @@ -1,7 +1,7 @@ // ANCHOR: here use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, }; // --snip-- diff --git a/listings/ch21-web-server/listing-21-06/Cargo.toml b/listings/ch21-web-server/listing-21-06/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-06/Cargo.toml +++ b/listings/ch21-web-server/listing-21-06/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-06/src/main.rs b/listings/ch21-web-server/listing-21-06/src/main.rs index 843d846766..2b26aef4e5 100644 --- a/listings/ch21-web-server/listing-21-06/src/main.rs +++ b/listings/ch21-web-server/listing-21-06/src/main.rs @@ -1,6 +1,6 @@ use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, }; diff --git a/listings/ch21-web-server/listing-21-07/Cargo.toml b/listings/ch21-web-server/listing-21-07/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-07/Cargo.toml +++ b/listings/ch21-web-server/listing-21-07/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-07/src/main.rs b/listings/ch21-web-server/listing-21-07/src/main.rs index e19467b83b..137ecd9eaf 100644 --- a/listings/ch21-web-server/listing-21-07/src/main.rs +++ b/listings/ch21-web-server/listing-21-07/src/main.rs @@ -1,6 +1,6 @@ use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, }; diff --git a/listings/ch21-web-server/listing-21-09/Cargo.toml b/listings/ch21-web-server/listing-21-09/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-09/Cargo.toml +++ b/listings/ch21-web-server/listing-21-09/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-09/src/main.rs b/listings/ch21-web-server/listing-21-09/src/main.rs index 0f9356ab02..001491de6f 100644 --- a/listings/ch21-web-server/listing-21-09/src/main.rs +++ b/listings/ch21-web-server/listing-21-09/src/main.rs @@ -1,6 +1,6 @@ use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, }; diff --git a/listings/ch21-web-server/listing-21-10/Cargo.toml b/listings/ch21-web-server/listing-21-10/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-10/Cargo.toml +++ b/listings/ch21-web-server/listing-21-10/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-10/src/main.rs b/listings/ch21-web-server/listing-21-10/src/main.rs index 0679ec6002..81b36562af 100644 --- a/listings/ch21-web-server/listing-21-10/src/main.rs +++ b/listings/ch21-web-server/listing-21-10/src/main.rs @@ -1,7 +1,7 @@ // ANCHOR: here use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-11/Cargo.toml b/listings/ch21-web-server/listing-21-11/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-11/Cargo.toml +++ b/listings/ch21-web-server/listing-21-11/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-11/src/main.rs b/listings/ch21-web-server/listing-21-11/src/main.rs index 075a0d9de6..dd3c52b3fd 100644 --- a/listings/ch21-web-server/listing-21-11/src/main.rs +++ b/listings/ch21-web-server/listing-21-11/src/main.rs @@ -1,6 +1,6 @@ use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-12/Cargo.toml b/listings/ch21-web-server/listing-21-12/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-12/Cargo.toml +++ b/listings/ch21-web-server/listing-21-12/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-12/src/main.rs b/listings/ch21-web-server/listing-21-12/src/main.rs index bde3e29d10..fb0678f032 100644 --- a/listings/ch21-web-server/listing-21-12/src/main.rs +++ b/listings/ch21-web-server/listing-21-12/src/main.rs @@ -1,6 +1,6 @@ use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-13/Cargo.toml b/listings/ch21-web-server/listing-21-13/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-13/Cargo.toml +++ b/listings/ch21-web-server/listing-21-13/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-13/src/main.rs b/listings/ch21-web-server/listing-21-13/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-13/src/main.rs +++ b/listings/ch21-web-server/listing-21-13/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-14/Cargo.toml b/listings/ch21-web-server/listing-21-14/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-14/Cargo.toml +++ b/listings/ch21-web-server/listing-21-14/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-14/src/main.rs b/listings/ch21-web-server/listing-21-14/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-14/src/main.rs +++ b/listings/ch21-web-server/listing-21-14/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-15/Cargo.toml b/listings/ch21-web-server/listing-21-15/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-15/Cargo.toml +++ b/listings/ch21-web-server/listing-21-15/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-15/src/main.rs b/listings/ch21-web-server/listing-21-15/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-15/src/main.rs +++ b/listings/ch21-web-server/listing-21-15/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-16/Cargo.toml b/listings/ch21-web-server/listing-21-16/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-16/Cargo.toml +++ b/listings/ch21-web-server/listing-21-16/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-16/src/main.rs b/listings/ch21-web-server/listing-21-16/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-16/src/main.rs +++ b/listings/ch21-web-server/listing-21-16/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-17/Cargo.toml b/listings/ch21-web-server/listing-21-17/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-17/Cargo.toml +++ b/listings/ch21-web-server/listing-21-17/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-17/src/main.rs b/listings/ch21-web-server/listing-21-17/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-17/src/main.rs +++ b/listings/ch21-web-server/listing-21-17/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-18/Cargo.toml b/listings/ch21-web-server/listing-21-18/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-18/Cargo.toml +++ b/listings/ch21-web-server/listing-21-18/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-18/src/lib.rs b/listings/ch21-web-server/listing-21-18/src/lib.rs index 4bff8acada..7df8ed35a5 100644 --- a/listings/ch21-web-server/listing-21-18/src/lib.rs +++ b/listings/ch21-web-server/listing-21-18/src/lib.rs @@ -1,6 +1,6 @@ // ANCHOR: here use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; // --snip-- diff --git a/listings/ch21-web-server/listing-21-18/src/main.rs b/listings/ch21-web-server/listing-21-18/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-18/src/main.rs +++ b/listings/ch21-web-server/listing-21-18/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-19/Cargo.toml b/listings/ch21-web-server/listing-21-19/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-19/Cargo.toml +++ b/listings/ch21-web-server/listing-21-19/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-19/src/lib.rs b/listings/ch21-web-server/listing-21-19/src/lib.rs index aeb1facd64..c240becf15 100644 --- a/listings/ch21-web-server/listing-21-19/src/lib.rs +++ b/listings/ch21-web-server/listing-21-19/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; diff --git a/listings/ch21-web-server/listing-21-19/src/main.rs b/listings/ch21-web-server/listing-21-19/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-19/src/main.rs +++ b/listings/ch21-web-server/listing-21-19/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-20/Cargo.toml b/listings/ch21-web-server/listing-21-20/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-20/Cargo.toml +++ b/listings/ch21-web-server/listing-21-20/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-20/src/lib.rs b/listings/ch21-web-server/listing-21-20/src/lib.rs index 86157c9e71..17540e7bea 100644 --- a/listings/ch21-web-server/listing-21-20/src/lib.rs +++ b/listings/ch21-web-server/listing-21-20/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -54,12 +54,14 @@ struct Worker { impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let job = receiver.lock().unwrap().recv().unwrap(); + let thread = thread::spawn(move || { + loop { + let job = receiver.lock().unwrap().recv().unwrap(); - println!("Worker {id} got a job; executing."); + println!("Worker {id} got a job; executing."); - job(); + job(); + } }); Worker { id, thread } diff --git a/listings/ch21-web-server/listing-21-20/src/main.rs b/listings/ch21-web-server/listing-21-20/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-20/src/main.rs +++ b/listings/ch21-web-server/listing-21-20/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-21/Cargo.toml b/listings/ch21-web-server/listing-21-21/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-21/Cargo.toml +++ b/listings/ch21-web-server/listing-21-21/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-21/src/lib.rs b/listings/ch21-web-server/listing-21-21/src/lib.rs index 17b37e77be..be899feec1 100644 --- a/listings/ch21-web-server/listing-21-21/src/lib.rs +++ b/listings/ch21-web-server/listing-21-21/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; diff --git a/listings/ch21-web-server/listing-21-21/src/main.rs b/listings/ch21-web-server/listing-21-21/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-21/src/main.rs +++ b/listings/ch21-web-server/listing-21-21/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-22/Cargo.toml b/listings/ch21-web-server/listing-21-22/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-22/Cargo.toml +++ b/listings/ch21-web-server/listing-21-22/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-22/output.txt b/listings/ch21-web-server/listing-21-22/output.txt index c0165dbb80..9362f927e6 100644 --- a/listings/ch21-web-server/listing-21-22/output.txt +++ b/listings/ch21-web-server/listing-21-22/output.txt @@ -9,9 +9,9 @@ error[E0507]: cannot move out of `worker.thread` which is behind a mutable refer | move occurs because `worker.thread` has type `JoinHandle<()>`, which does not implement the `Copy` trait | note: `JoinHandle::::join` takes ownership of the receiver `self`, which moves `worker.thread` - --> file:///home/.rustup/toolchains/1.82/lib/rustlib/src/rust/library/std/src/thread/mod.rs:1763:17 + --> file:///home/.rustup/toolchains/1.85/lib/rustlib/src/rust/library/std/src/thread/mod.rs:1876:17 | -1763 | pub fn join(self) -> Result { +1876 | pub fn join(self) -> Result { | ^^^^ For more information about this error, try `rustc --explain E0507`. diff --git a/listings/ch21-web-server/listing-21-22/src/lib.rs b/listings/ch21-web-server/listing-21-22/src/lib.rs index 72a8c48088..7c7eb6e14a 100644 --- a/listings/ch21-web-server/listing-21-22/src/lib.rs +++ b/listings/ch21-web-server/listing-21-22/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -63,12 +63,14 @@ struct Worker { impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let job = receiver.lock().unwrap().recv().unwrap(); + let thread = thread::spawn(move || { + loop { + let job = receiver.lock().unwrap().recv().unwrap(); - println!("Worker {id} got a job; executing."); + println!("Worker {id} got a job; executing."); - job(); + job(); + } }); Worker { id, thread } diff --git a/listings/ch21-web-server/listing-21-22/src/main.rs b/listings/ch21-web-server/listing-21-22/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/listing-21-22/src/main.rs +++ b/listings/ch21-web-server/listing-21-22/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-23/Cargo.toml b/listings/ch21-web-server/listing-21-23/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-23/Cargo.toml +++ b/listings/ch21-web-server/listing-21-23/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-23/src/lib.rs b/listings/ch21-web-server/listing-21-23/src/lib.rs index b4d81571bc..a767864339 100644 --- a/listings/ch21-web-server/listing-21-23/src/lib.rs +++ b/listings/ch21-web-server/listing-21-23/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -77,12 +77,14 @@ struct Worker { impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let job = receiver.lock().unwrap().recv().unwrap(); + let thread = thread::spawn(move || { + loop { + let job = receiver.lock().unwrap().recv().unwrap(); - println!("Worker {id} got a job; executing."); + println!("Worker {id} got a job; executing."); - job(); + job(); + } }); Worker { id, thread } diff --git a/listings/ch21-web-server/listing-21-23/src/main.rs b/listings/ch21-web-server/listing-21-23/src/main.rs index acd703f274..f68c11e0b2 100644 --- a/listings/ch21-web-server/listing-21-23/src/main.rs +++ b/listings/ch21-web-server/listing-21-23/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-24/Cargo.toml b/listings/ch21-web-server/listing-21-24/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-24/Cargo.toml +++ b/listings/ch21-web-server/listing-21-24/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-24/src/lib.rs b/listings/ch21-web-server/listing-21-24/src/lib.rs index 10a50ef7b6..cef880db14 100644 --- a/listings/ch21-web-server/listing-21-24/src/lib.rs +++ b/listings/ch21-web-server/listing-21-24/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -67,18 +67,20 @@ struct Worker { // ANCHOR: here impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let message = receiver.lock().unwrap().recv(); - - match message { - Ok(job) => { - println!("Worker {id} got a job; executing."); - - job(); - } - Err(_) => { - println!("Worker {id} disconnected; shutting down."); - break; + let thread = thread::spawn(move || { + loop { + let message = receiver.lock().unwrap().recv(); + + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); + + job(); + } + Err(_) => { + println!("Worker {id} disconnected; shutting down."); + break; + } } } }); diff --git a/listings/ch21-web-server/listing-21-24/src/main.rs b/listings/ch21-web-server/listing-21-24/src/main.rs index acd703f274..f68c11e0b2 100644 --- a/listings/ch21-web-server/listing-21-24/src/main.rs +++ b/listings/ch21-web-server/listing-21-24/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/listing-21-25/Cargo.toml b/listings/ch21-web-server/listing-21-25/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/listing-21-25/Cargo.toml +++ b/listings/ch21-web-server/listing-21-25/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/listing-21-25/src/lib.rs b/listings/ch21-web-server/listing-21-25/src/lib.rs index 2727118495..8db88f20ed 100644 --- a/listings/ch21-web-server/listing-21-25/src/lib.rs +++ b/listings/ch21-web-server/listing-21-25/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -66,18 +66,20 @@ struct Worker { impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let message = receiver.lock().unwrap().recv(); - - match message { - Ok(job) => { - println!("Worker {id} got a job; executing."); - - job(); - } - Err(_) => { - println!("Worker {id} disconnected; shutting down."); - break; + let thread = thread::spawn(move || { + loop { + let message = receiver.lock().unwrap().recv(); + + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); + + job(); + } + Err(_) => { + println!("Worker {id} disconnected; shutting down."); + break; + } } } }); diff --git a/listings/ch21-web-server/listing-21-25/src/main.rs b/listings/ch21-web-server/listing-21-25/src/main.rs index ee0f1efe74..dabf2e474c 100644 --- a/listings/ch21-web-server/listing-21-25/src/main.rs +++ b/listings/ch21-web-server/listing-21-25/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/no-listing-01-define-threadpool-struct/Cargo.toml b/listings/ch21-web-server/no-listing-01-define-threadpool-struct/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/no-listing-01-define-threadpool-struct/Cargo.toml +++ b/listings/ch21-web-server/no-listing-01-define-threadpool-struct/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/no-listing-01-define-threadpool-struct/src/main.rs b/listings/ch21-web-server/no-listing-01-define-threadpool-struct/src/main.rs index e68f72c700..e3c522caef 100644 --- a/listings/ch21-web-server/no-listing-01-define-threadpool-struct/src/main.rs +++ b/listings/ch21-web-server/no-listing-01-define-threadpool-struct/src/main.rs @@ -3,7 +3,7 @@ use hello::ThreadPool; // ANCHOR_END: here use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/no-listing-02-impl-threadpool-new/Cargo.toml b/listings/ch21-web-server/no-listing-02-impl-threadpool-new/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/no-listing-02-impl-threadpool-new/Cargo.toml +++ b/listings/ch21-web-server/no-listing-02-impl-threadpool-new/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/no-listing-02-impl-threadpool-new/src/main.rs b/listings/ch21-web-server/no-listing-02-impl-threadpool-new/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/no-listing-02-impl-threadpool-new/src/main.rs +++ b/listings/ch21-web-server/no-listing-02-impl-threadpool-new/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/no-listing-03-define-execute/Cargo.toml b/listings/ch21-web-server/no-listing-03-define-execute/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/no-listing-03-define-execute/Cargo.toml +++ b/listings/ch21-web-server/no-listing-03-define-execute/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/no-listing-03-define-execute/src/main.rs b/listings/ch21-web-server/no-listing-03-define-execute/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/no-listing-03-define-execute/src/main.rs +++ b/listings/ch21-web-server/no-listing-03-define-execute/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/no-listing-04-update-drop-definition/Cargo.toml b/listings/ch21-web-server/no-listing-04-update-drop-definition/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/no-listing-04-update-drop-definition/Cargo.toml +++ b/listings/ch21-web-server/no-listing-04-update-drop-definition/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/no-listing-04-update-drop-definition/output.txt b/listings/ch21-web-server/no-listing-04-update-drop-definition/output.txt index 1ac14a444b..a59b08bcdd 100644 --- a/listings/ch21-web-server/no-listing-04-update-drop-definition/output.txt +++ b/listings/ch21-web-server/no-listing-04-update-drop-definition/output.txt @@ -1,34 +1,3 @@ $ cargo check Checking hello v0.1.0 (file:///projects/hello) -error[E0599]: no method named `join` found for enum `Option` in the current scope - --> src/lib.rs:52:27 - | -52 | worker.thread.join().unwrap(); - | ^^^^ method not found in `Option>` - | -note: the method `join` exists on the type `JoinHandle<()>` - --> file:///home/.rustup/toolchains/1.82/lib/rustlib/src/rust/library/std/src/thread/mod.rs:1763:5 - | -1763 | pub fn join(self) -> Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -help: consider using `Option::expect` to unwrap the `JoinHandle<()>` value, panicking if the value is an `Option::None` - | -52 | worker.thread.expect("REASON").join().unwrap(); - | +++++++++++++++++ - -error[E0308]: mismatched types - --> src/lib.rs:72:22 - | -72 | Worker { id, thread } - | ^^^^^^ expected `Option>`, found `JoinHandle<_>` - | - = note: expected enum `Option>` - found struct `JoinHandle<_>` -help: try wrapping the expression in `Some` - | -72 | Worker { id, thread: Some(thread) } - | +++++++++++++ + - -Some errors have detailed explanations: E0308, E0599. -For more information about an error, try `rustc --explain E0308`. -error: could not compile `hello` (lib) due to 2 previous errors + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s diff --git a/listings/ch21-web-server/no-listing-04-update-drop-definition/src/lib.rs b/listings/ch21-web-server/no-listing-04-update-drop-definition/src/lib.rs index 86f92766cf..d9fda0f256 100644 --- a/listings/ch21-web-server/no-listing-04-update-drop-definition/src/lib.rs +++ b/listings/ch21-web-server/no-listing-04-update-drop-definition/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -63,12 +63,14 @@ struct Worker { impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let job = receiver.lock().unwrap().recv().unwrap(); + let thread = thread::spawn(move || { + loop { + let job = receiver.lock().unwrap().recv().unwrap(); - println!("Worker {id} got a job; executing."); + println!("Worker {id} got a job; executing."); - job(); + job(); + } }); Worker { id, thread } diff --git a/listings/ch21-web-server/no-listing-04-update-drop-definition/src/main.rs b/listings/ch21-web-server/no-listing-04-update-drop-definition/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/no-listing-04-update-drop-definition/src/main.rs +++ b/listings/ch21-web-server/no-listing-04-update-drop-definition/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/no-listing-05-fix-worker-new/Cargo.toml b/listings/ch21-web-server/no-listing-05-fix-worker-new/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/no-listing-05-fix-worker-new/Cargo.toml +++ b/listings/ch21-web-server/no-listing-05-fix-worker-new/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/no-listing-05-fix-worker-new/src/lib.rs b/listings/ch21-web-server/no-listing-05-fix-worker-new/src/lib.rs index ede3750a17..31237a61a6 100644 --- a/listings/ch21-web-server/no-listing-05-fix-worker-new/src/lib.rs +++ b/listings/ch21-web-server/no-listing-05-fix-worker-new/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -65,12 +65,14 @@ impl Worker { // --snip-- // ANCHOR_END: here - let thread = thread::spawn(move || loop { - let job = receiver.lock().unwrap().recv().unwrap(); + let thread = thread::spawn(move || { + loop { + let job = receiver.lock().unwrap().recv().unwrap(); - println!("Worker {id} got a job; executing."); + println!("Worker {id} got a job; executing."); - job(); + job(); + } }); // ANCHOR: here diff --git a/listings/ch21-web-server/no-listing-05-fix-worker-new/src/main.rs b/listings/ch21-web-server/no-listing-05-fix-worker-new/src/main.rs index 1f075fde59..ca3608da70 100644 --- a/listings/ch21-web-server/no-listing-05-fix-worker-new/src/main.rs +++ b/listings/ch21-web-server/no-listing-05-fix-worker-new/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/Cargo.toml b/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/Cargo.toml +++ b/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/src/lib.rs b/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/src/lib.rs index b795ea53b0..9fb67e0186 100644 --- a/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/src/lib.rs +++ b/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -65,12 +65,14 @@ struct Worker { impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let job = receiver.lock().unwrap().recv().unwrap(); + let thread = thread::spawn(move || { + loop { + let job = receiver.lock().unwrap().recv().unwrap(); - println!("Worker {id} got a job; executing."); + println!("Worker {id} got a job; executing."); - job(); + job(); + } }); Worker { diff --git a/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/src/main.rs b/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/src/main.rs index acd703f274..f68c11e0b2 100644 --- a/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/src/main.rs +++ b/listings/ch21-web-server/no-listing-06-fix-threadpool-drop/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/listings/ch21-web-server/no-listing-07-final-code/Cargo.toml b/listings/ch21-web-server/no-listing-07-final-code/Cargo.toml index fe619478a6..f6f3649e20 100644 --- a/listings/ch21-web-server/no-listing-07-final-code/Cargo.toml +++ b/listings/ch21-web-server/no-listing-07-final-code/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hello" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch21-web-server/no-listing-07-final-code/src/lib.rs b/listings/ch21-web-server/no-listing-07-final-code/src/lib.rs index 54c0489abf..e8decb0cc2 100644 --- a/listings/ch21-web-server/no-listing-07-final-code/src/lib.rs +++ b/listings/ch21-web-server/no-listing-07-final-code/src/lib.rs @@ -1,5 +1,5 @@ use std::{ - sync::{mpsc, Arc, Mutex}, + sync::{Arc, Mutex, mpsc}, thread, }; @@ -68,18 +68,20 @@ struct Worker { impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let message = receiver.lock().unwrap().recv(); - - match message { - Ok(job) => { - println!("Worker {id} got a job; executing."); - - job(); - } - Err(_) => { - println!("Worker {id} disconnected; shutting down."); - break; + let thread = thread::spawn(move || { + loop { + let message = receiver.lock().unwrap().recv(); + + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); + + job(); + } + Err(_) => { + println!("Worker {id} disconnected; shutting down."); + break; + } } } }); diff --git a/listings/ch21-web-server/no-listing-07-final-code/src/main.rs b/listings/ch21-web-server/no-listing-07-final-code/src/main.rs index acd703f274..f68c11e0b2 100644 --- a/listings/ch21-web-server/no-listing-07-final-code/src/main.rs +++ b/listings/ch21-web-server/no-listing-07-final-code/src/main.rs @@ -1,7 +1,7 @@ use hello::ThreadPool; use std::{ fs, - io::{prelude::*, BufReader}, + io::{BufReader, prelude::*}, net::{TcpListener, TcpStream}, thread, time::Duration, diff --git a/nostarch/book.toml b/nostarch/book.toml index 50d3dc0775..8def0c1e5f 100644 --- a/nostarch/book.toml +++ b/nostarch/book.toml @@ -23,4 +23,4 @@ output-mode = "simple" output-mode = "simple" [rust] -edition = "2021" +edition = "2024" diff --git a/packages/tools/Cargo.toml b/packages/tools/Cargo.toml index a24a8d74e5..b7fdf35e83 100644 --- a/packages/tools/Cargo.toml +++ b/packages/tools/Cargo.toml @@ -2,7 +2,7 @@ name = "rust-book-tools" version = "0.0.1" description = "The Rust Book" -edition = "2021" +edition = "2024" [[bin]] name = "concat_chapters" diff --git a/packages/tools/src/bin/concat_chapters.rs b/packages/tools/src/bin/concat_chapters.rs index 046870edb0..127e93a84e 100644 --- a/packages/tools/src/bin/concat_chapters.rs +++ b/packages/tools/src/bin/concat_chapters.rs @@ -1,6 +1,6 @@ use std::collections::BTreeMap; use std::env; -use std::fs::{create_dir, read_dir, File}; +use std::fs::{File, create_dir, read_dir}; use std::io; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; diff --git a/packages/tools/src/bin/lfp.rs b/packages/tools/src/bin/lfp.rs index 64bdaa99d8..d4ab62d5d4 100644 --- a/packages/tools/src/bin/lfp.rs +++ b/packages/tools/src/bin/lfp.rs @@ -215,8 +215,8 @@ mod tests { } #[test] - fn is_file_of_interest_returns_false_when_the_filename_does_not_have_the_md_extension( - ) { + fn is_file_of_interest_returns_false_when_the_filename_does_not_have_the_md_extension() + { let uninteresting_fn = "src/img/foo1.png"; assert!(!super::is_file_of_interest(path::Path::new( @@ -233,8 +233,8 @@ mod tests { } #[test] - fn is_line_of_interest_does_not_report_a_line_if_the_line_contains_a_file_url_which_is_directly_followed_by_the_project_path( - ) { + fn is_line_of_interest_does_not_report_a_line_if_the_line_contains_a_file_url_which_is_directly_followed_by_the_project_path() + { let sample_line = "Compiling guessing_game v0.1.0 (file:///projects/guessing_game)"; @@ -242,8 +242,8 @@ mod tests { } #[test] - fn is_line_of_interest_reports_a_line_if_the_line_contains_a_file_url_which_is_not_directly_followed_by_the_project_path( - ) { + fn is_line_of_interest_reports_a_line_if_the_line_contains_a_file_url_which_is_not_directly_followed_by_the_project_path() + { let sample_line = "Compiling guessing_game v0.1.0 (file:///home/you/projects/guessing_game)"; assert!(super::is_line_of_interest(sample_line)); diff --git a/packages/trpl/Cargo.toml b/packages/trpl/Cargo.toml index a76c8261b9..aade4757b0 100644 --- a/packages/trpl/Cargo.toml +++ b/packages/trpl/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "trpl" version = "0.2.0" -edition = "2021" +edition = "2024" license = "MIT OR Apache-2.0" description = "A support crate for The Rust Programming Language book" readme = "README.md" diff --git a/packages/trpl/src/lib.rs b/packages/trpl/src/lib.rs index 999cb6e273..fcc7859091 100644 --- a/packages/trpl/src/lib.rs +++ b/packages/trpl/src/lib.rs @@ -21,7 +21,7 @@ use futures::future; // Re-exports, to be used like `trpl::join`. pub use futures::{ - future::{join, join3, join_all, Either}, + future::{Either, join, join_all, join3}, join, }; pub use tokio::{ @@ -39,17 +39,16 @@ pub use tokio::{ // readers are not asking why `unbounded` is now important and can focus on // the more important differences between sync and async APIs. sync::mpsc::{ - unbounded_channel as channel, UnboundedReceiver as Receiver, - UnboundedSender as Sender, + UnboundedReceiver as Receiver, UnboundedSender as Sender, + unbounded_channel as channel, }, - task::{spawn as spawn_task, yield_now, JoinHandle}, + task::{JoinHandle, spawn as spawn_task, yield_now}, time::{interval, sleep}, }; pub use tokio_stream::{ - iter as stream_from_iter, + Stream, StreamExt, iter as stream_from_iter, wrappers::{IntervalStream, UnboundedReceiverStream as ReceiverStream}, - Stream, StreamExt, }; /// Run a single future to completion on a bespoke Tokio `Runtime`. diff --git a/rust-toolchain b/rust-toolchain index a92432a8ab..c4f7465a91 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.82 +1.85 diff --git a/src/title-page.md b/src/title-page.md index 8d492c7d1c..5d16f7f98f 100644 --- a/src/title-page.md +++ b/src/title-page.md @@ -3,7 +3,7 @@ _by Steve Klabnik, Carol Nichols, and Chris Krycho, with contributions from the Rust Community_ -This version of the text assumes you’re using Rust 1.82.0 (released 2024-10-17) +This version of the text assumes you’re using Rust 1.85.0 (released 2025-02-17) or later. See the [“Installation” section of Chapter 1][install] to install or update Rust. diff --git a/tools/update-editions.sh b/tools/update-editions.sh index bd52bc9c81..3f1fa15cb8 100755 --- a/tools/update-editions.sh +++ b/tools/update-editions.sh @@ -2,7 +2,7 @@ set -eu -OLD_EDITION=2018 -NEW_EDITION=2021 +OLD_EDITION=2021 +NEW_EDITION=2024 find listings/** -name "Cargo.toml" -exec sed -i '' "s/edition = \"$OLD_EDITION\"/edition = \"$NEW_EDITION\"/g" '{}' \;