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 78c94fe..122c1bd 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-01/src/main.rs b/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs index b822b89..d44e290 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/listing-02-01/src/main.rs @@ -25,7 +25,7 @@ fn main() { // ANCHOR_END: expect // ANCHOR: print_guess - println!("You guessed: {}", guess); + println!("You guessed: {guess}"); // ANCHOR_END: print_guess } // ANCHOR: all diff --git a/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock b/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock index 0fb52b3..b3b58cc 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock +++ b/listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock @@ -1,6 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cfg-if" @@ -10,9 +16,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -28,15 +34,36 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] [[package]] name = "rand" @@ -68,8 +95,46 @@ dependencies = [ "getrandom", ] +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] 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 7eda67a..eba27a8 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 7eda67a..eba27a8 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-03/src/main.rs b/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs index 1ba2d4d..0ae11e3 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/listing-02-03/src/main.rs @@ -1,5 +1,6 @@ // ANCHOR: all use std::io; + // ANCHOR: ch07-04 use rand::Rng; 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 7eda67a..eba27a8 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 0f0bc21..ca5e058 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt +++ b/listings/ch02-guessing-game-tutorial/listing-02-04/output.txt @@ -1,10 +1,4 @@ $ cargo build - Downloading crates ... - Downloaded rand_core v0.6.2 - Downloaded getrandom v0.2.2 - Downloaded rand_chacha v0.3.0 - Downloaded ppv-lite86 v0.2.10 - Downloaded libc v0.2.86 Compiling libc v0.2.86 Compiling getrandom v0.2.2 Compiling cfg-if v1.0.0 @@ -14,9 +8,9 @@ $ cargo build Compiling rand v0.8.5 Compiling guessing_game v0.1.0 (file:///projects/guessing_game) error[E0308]: mismatched types - --> src/main.rs:22:21 + --> src/main.rs:23:21 | -22 | match guess.cmp(&secret_number) { +23 | match guess.cmp(&secret_number) { | --- ^^^^^^^^^^^^^^ expected `&String`, found `&{integer}` | | | arguments to this method are incorrect @@ -24,7 +18,7 @@ error[E0308]: mismatched types = note: expected reference `&String` found reference `&{integer}` note: method defined here - --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cmp.rs:839:8 + --> /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/core/src/cmp.rs:964:8 For more information about this error, try `rustc --explain E0308`. error: could not compile `guessing_game` (bin "guessing_game") due to 1 previous error diff --git a/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs b/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs index 6e58a76..fae3c29 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/listing-02-04/src/main.rs @@ -1,8 +1,9 @@ // ANCHOR: here -use rand::Rng; use std::cmp::Ordering; use std::io; +use rand::Rng; + fn main() { // --snip-- // ANCHOR_END: here 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 7eda67a..eba27a8 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-05/src/main.rs b/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs index 12f497e..0ca4853 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/listing-02-05/src/main.rs @@ -1,7 +1,8 @@ -use rand::Rng; use std::cmp::Ordering; use std::io; +use rand::Rng; + fn main() { println!("Guess the number!"); 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 7eda67a..eba27a8 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/listing-02-06/src/main.rs b/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs index 7fcbb99..bd728b4 100644 --- a/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/listing-02-06/src/main.rs @@ -1,7 +1,8 @@ -use rand::Rng; use std::cmp::Ordering; use std::io; +use rand::Rng; + fn main() { println!("Guess the number!"); 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 78c94fe..53e7b39 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,8 +1,6 @@ [package] name = "guessing_game" version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +edition = "2024" [dependencies] diff --git a/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt b/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt index 33409e3..d3ca35c 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt +++ b/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/output.txt @@ -1,5 +1,5 @@ $ cargo run Compiling guessing_game v0.1.0 (file:///projects/guessing_game) - Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.50s + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s Running `target/debug/guessing_game` Hello, world! 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 78c94fe..122c1bd 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 7eda67a..eba27a8 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-03-convert-string-to-number/src/main.rs b/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs index 7f076c5..e4ec0c9 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs @@ -1,7 +1,8 @@ -use rand::Rng; use std::cmp::Ordering; use std::io; +use rand::Rng; + fn main() { println!("Guess the number!"); 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 7eda67a..eba27a8 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-04-looping/src/main.rs b/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs index f97d1c5..934be44 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/no-listing-04-looping/src/main.rs @@ -1,7 +1,8 @@ -use rand::Rng; use std::cmp::Ordering; use std::io; +use rand::Rng; + fn main() { println!("Guess the number!"); 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 7eda67a..eba27a8 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/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs b/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs index def0a0e..77cbc93 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs +++ b/listings/ch02-guessing-game-tutorial/no-listing-05-quitting/src/main.rs @@ -1,7 +1,8 @@ -use rand::Rng; use std::cmp::Ordering; use std::io; +use rand::Rng; + fn main() { println!("Guess the number!"); 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 478b346..9c392ab 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 6596455..b12fd97 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 810e8bb..a046a76 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 810e8bb..a046a76 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 810e8bb..a046a76 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 4da3b81..c093eb6 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 4da3b81..c093eb6 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 4da3b81..c093eb6 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 4da3b81..c093eb6 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 4da3b81..c093eb6 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 83610e7..c293ee0 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 b4bea55..98935b4 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 47e42ce..4a6f21a 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 a1ef3b5..613f326 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 9b0879c..29036e9 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 9b0879c..29036e9 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 9b0879c..29036e9 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 96be3e2..564293c 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 96be3e2..564293c 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 96be3e2..564293c 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 478b346..9c392ab 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 478b346..9c392ab 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 478b346..9c392ab 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 478b346..9c392ab 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 478b346..9c392ab 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 478b346..9c392ab 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 478b346..9c392ab 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 478b346..9c392ab 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 e0576b5..e4bffc6 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-24-comments-end-of-line/src/main.rs b/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs index 535f4b9..64b55db 100644 --- a/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs +++ b/listings/ch03-common-programming-concepts/no-listing-24-comments-end-of-line/src/main.rs @@ -1,3 +1,3 @@ fn main() { - let lucky_number = 7; // I’m feeling lucky today + let lucky_number = 7; // I'm feeling lucky today } 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 e0576b5..e4bffc6 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-25-comments-above-line/src/main.rs b/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs index 81cd935..2d619c2 100644 --- a/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs +++ b/listings/ch03-common-programming-concepts/no-listing-25-comments-above-line/src/main.rs @@ -1,4 +1,4 @@ fn main() { - // I’m feeling lucky today + // I'm feeling lucky today let lucky_number = 7; } 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 6596455..b12fd97 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 6596455..b12fd97 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 6596455..b12fd97 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 6596455..b12fd97 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 6596455..b12fd97 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 6596455..b12fd97 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 810e8bb..a046a76 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 810e8bb..a046a76 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 810e8bb..a046a76 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 810e8bb..a046a76 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 8ad4d5a..05020d2 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 e884752..a4b0049 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-01/src/main.rs b/listings/ch04-understanding-ownership/listing-04-01/src/main.rs index 088d37a..9181a97 100644 --- a/listings/ch04-understanding-ownership/listing-04-01/src/main.rs +++ b/listings/ch04-understanding-ownership/listing-04-01/src/main.rs @@ -6,4 +6,4 @@ fn main() { // 使用 s } // 此作用域已结束,s 不再有效 // ANCHOR_END: here -} \ No newline at end of file +} diff --git a/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-02/Cargo.toml index e884752..a4b0049 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 e884752..a4b0049 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-03/src/main.rs b/listings/ch04-understanding-ownership/listing-04-03/src/main.rs index 3aa6cba..9494e5b 100644 --- a/listings/ch04-understanding-ownership/listing-04-03/src/main.rs +++ b/listings/ch04-understanding-ownership/listing-04-03/src/main.rs @@ -8,7 +8,7 @@ fn main() { makes_copy(x); // x 应该移动函数里, // 但 i32 是 Copy 的, - // 所以在后面可继续使用 x + println!("{}", x); // 所以在后面可继续使用 x } // 这里,x 先移出了作用域,然后是 s。但因为 s 的值已被移走, // 没有特殊之处 diff --git a/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-04/Cargo.toml index e884752..a4b0049 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-04/src/main.rs b/listings/ch04-understanding-ownership/listing-04-04/src/main.rs index b550f93..c59c77b 100644 --- a/listings/ch04-understanding-ownership/listing-04-04/src/main.rs +++ b/listings/ch04-understanding-ownership/listing-04-04/src/main.rs @@ -1,29 +1,30 @@ fn main() { - let s1 = gives_ownership(); // gives_ownership 将返回值 - // 转移给 s1 + let s1 = gives_ownership(); // gives_ownership moves its return + // value into s1 - let s2 = String::from("hello"); // s2 进入作用域 + let s2 = String::from("hello"); // s2 comes into scope - let s3 = takes_and_gives_back(s2); // s2 被移动到 - // takes_and_gives_back 中, - // 它也将返回值移给 s3 -} // 这里,s3 移出作用域并被丢弃。s2 也移出作用域,但已被移走, - // 所以什么也不会发生。s1 离开作用域并被丢弃 + let s3 = takes_and_gives_back(s2); // s2 is moved into + // takes_and_gives_back, which also + // moves its return value into s3 +} // Here, s3 goes out of scope and is dropped. s2 was moved, so nothing + // happens. s1 goes out of scope and is dropped. -fn gives_ownership() -> String { // gives_ownership 会将 - // 返回值移动给 - // 调用它的函数 +fn gives_ownership() -> String { // gives_ownership will move its + // return value into the function + // that calls it - let some_string = String::from("yours"); // some_string 进入作用域。 + let some_string = String::from("yours"); // some_string comes into scope - some_string // 返回 some_string - // 并移出给调用的函数 - // + some_string // some_string is returned and + // moves out to the calling + // function } -// takes_and_gives_back 将传入字符串并返回该值 -fn takes_and_gives_back(a_string: String) -> String { // a_string 进入作用域 - // +// 该函数将传入字符串并返回该值 +fn takes_and_gives_back(a_string: String) -> String { + // a_string comes into + // scope a_string // 返回 a_string 并移出给调用的函数 } diff --git a/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml b/listings/ch04-understanding-ownership/listing-04-05/Cargo.toml index e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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-02-string-scope/Cargo.toml b/listings/ch04-understanding-ownership/no-listing-02-string-scope/Cargo.toml index e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 e884752..a4b0049 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 3232b60..7251aaa 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 3232b60..7251aaa 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 3232b60..7251aaa 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 3232b60..7251aaa 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 3232b60..7251aaa 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 3232b60..7251aaa 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 3232b60..7251aaa 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 3232b60..7251aaa 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 d36dbc1..748f9d6 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 4a279a4..bd5e247 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 3232b60..7251aaa 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 4a279a4..bd5e247 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.lock b/listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.lock similarity index 89% rename from listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.lock rename to listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.lock index d37189b..f62e8ac 100644 --- a/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.lock +++ b/listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "adder" +name = "enums" version = "0.1.0" diff --git a/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/Cargo.toml b/listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.toml similarity index 57% rename from listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/Cargo.toml rename to listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.toml index e61cb12..d4e6b38 100644 --- a/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/Cargo.toml +++ b/listings/ch06-enums-and-pattern-matching/listing-06-07/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "adder" +name = "enums" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-07/src/main.rs b/listings/ch06-enums-and-pattern-matching/listing-06-07/src/main.rs new file mode 100644 index 0000000..af7ec51 --- /dev/null +++ b/listings/ch06-enums-and-pattern-matching/listing-06-07/src/main.rs @@ -0,0 +1,45 @@ +#[derive(Debug)] // so we can inspect the state in a minute +enum UsState { + Alabama, + Alaska, + // --snip-- +} + +// ANCHOR: state +impl UsState { + fn existed_in(&self, year: u16) -> bool { + match self { + UsState::Alabama => year >= 1819, + UsState::Alaska => year >= 1959, + // -- snip -- + } + } +} +// ANCHOR_END: state + +enum Coin { + Penny, + Nickel, + Dime, + Quarter(UsState), +} + +// ANCHOR: describe +fn describe_state_quarter(coin: Coin) -> Option { + if let Coin::Quarter(state) = coin { + if state.existed_in(1900) { + Some(format!("{state:?} is pretty old, for America!")) + } else { + Some(format!("{state:?} is relatively new.")) + } + } else { + None + } +} +// ANCHOR_END: describe + +fn main() { + if let Some(desc) = describe_state_quarter(Coin::Quarter(UsState::Alaska)) { + println!("{desc}"); + } +} diff --git a/listings/ch11-writing-automated-tests/listing-11-01/Cargo.lock b/listings/ch06-enums-and-pattern-matching/listing-06-08/Cargo.lock similarity index 81% rename from listings/ch11-writing-automated-tests/listing-11-01/Cargo.lock rename to listings/ch06-enums-and-pattern-matching/listing-06-08/Cargo.lock index 8b8c69d..f62e8ac 100644 --- a/listings/ch11-writing-automated-tests/listing-11-01/Cargo.lock +++ b/listings/ch06-enums-and-pattern-matching/listing-06-08/Cargo.lock @@ -1,7 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] -name = "adder" +name = "enums" version = "0.1.0" + 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 new file mode 100644 index 0000000..d4e6b38 --- /dev/null +++ b/listings/ch06-enums-and-pattern-matching/listing-06-08/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-08/src/main.rs b/listings/ch06-enums-and-pattern-matching/listing-06-08/src/main.rs new file mode 100644 index 0000000..cde9f04 --- /dev/null +++ b/listings/ch06-enums-and-pattern-matching/listing-06-08/src/main.rs @@ -0,0 +1,45 @@ +#[derive(Debug)] // so we can inspect the state in a minute +enum UsState { + Alabama, + Alaska, + // --snip-- +} + +impl UsState { + fn existed_in(&self, year: u16) -> bool { + match self { + UsState::Alabama => year >= 1819, + UsState::Alaska => year >= 1959, + // -- snip -- + } + } +} + +enum Coin { + Penny, + Nickel, + Dime, + Quarter(UsState), +} + +// ANCHOR: describe +fn describe_state_quarter(coin: Coin) -> Option { + let state = if let Coin::Quarter(state) = coin { + state + } else { + return None; + }; + + if state.existed_in(1900) { + Some(format!("{state:?} is pretty old, for America!")) + } else { + Some(format!("{state:?} is relatively new.")) + } +} +// ANCHOR_END: describe + +fn main() { + if let Some(desc) = describe_state_quarter(Coin::Quarter(UsState::Alaska)) { + println!("{desc}"); + } +} diff --git a/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock b/listings/ch06-enums-and-pattern-matching/listing-06-09/Cargo.lock similarity index 77% rename from listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock rename to listings/ch06-enums-and-pattern-matching/listing-06-09/Cargo.lock index ee5d790..f62e8ac 100644 --- a/listings/ch02-guessing-game-tutorial/no-listing-01-cargo-new/Cargo.lock +++ b/listings/ch06-enums-and-pattern-matching/listing-06-09/Cargo.lock @@ -1,7 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] -name = "guessing_game" +name = "enums" version = "0.1.0" + 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 new file mode 100644 index 0000000..d4e6b38 --- /dev/null +++ b/listings/ch06-enums-and-pattern-matching/listing-06-09/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "enums" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/listings/ch06-enums-and-pattern-matching/listing-06-09/src/main.rs b/listings/ch06-enums-and-pattern-matching/listing-06-09/src/main.rs new file mode 100644 index 0000000..cffa151 --- /dev/null +++ b/listings/ch06-enums-and-pattern-matching/listing-06-09/src/main.rs @@ -0,0 +1,43 @@ +#[derive(Debug)] // so we can inspect the state in a minute +enum UsState { + Alabama, + Alaska, + // --snip-- +} + +impl UsState { + fn existed_in(&self, year: u16) -> bool { + match self { + UsState::Alabama => year >= 1819, + UsState::Alaska => year >= 1959, + // -- snip -- + } + } +} + +enum Coin { + Penny, + Nickel, + Dime, + Quarter(UsState), +} + +// ANCHOR: describe +fn describe_state_quarter(coin: Coin) -> Option { + let Coin::Quarter(state) = coin else { + return None; + }; + + if state.existed_in(1900) { + Some(format!("{state:?} is pretty old, for America!")) + } else { + Some(format!("{state:?} is relatively new.")) + } +} +// ANCHOR_END: describe + +fn main() { + if let Some(desc) = describe_state_quarter(Coin::Quarter(UsState::Alaska)) { + println!("{desc}"); + } +} 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 ade2d75..c403b3d 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); // 元组结构体 struct ChangeColorMessage(i32, i32, i32); // 元组结构体 - // 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 1eb76de..78e064d 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 43acd14..e8b7637 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,8 +7,8 @@ error[E0004]: non-exhaustive patterns: `None` not covered | ^ pattern `None` not covered | note: `Option` defined here - --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:574:1 - ::: /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/option.rs:578:5 + --> /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/core/src/option.rs:572:1 + ::: /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/core/src/option.rs:576:5 | = note: not covered = note: the matched value is of type `Option` 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 e959295..d4e6b38 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 98d8d6e..199e8a9 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-05/src/lib.rs b/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs index 7325a85..b163d17 100644 --- a/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs +++ b/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs @@ -1,9 +1,12 @@ +// ANCHOR: here mod front_of_house { pub mod hosting { fn add_to_waitlist() {} } } +// -- snip -- +// ANCHOR_END: here pub fn eat_at_restaurant() { // 绝对路径 crate::front_of_house::hosting::add_to_waitlist(); 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 60cec7c..8e47b7a 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-07/src/lib.rs b/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs index 7063ad8..e3cf34b 100644 --- a/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs +++ b/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs @@ -1,9 +1,12 @@ +// ANCHOR: here mod front_of_house { pub mod hosting { pub fn add_to_waitlist() {} } } +// -- snip -- +// ANCHOR_END: here pub fn eat_at_restaurant() { // 绝对路径 crate::front_of_house::hosting::add_to_waitlist(); 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 d508e95..9f9c4ac 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 60cec7c..8e47b7a 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 7eda67a..eba27a8 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 60cec7c..8e47b7a 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 6e904ab..49be9c5 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 abda2db..a7d2dfa 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 10b5326..b712470 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; // 注意 s1 被移动了,不能继续使用 - // 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 fe49598..fd85423 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 75d9a56..2684a25 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-19/src/main.rs b/listings/ch08-common-collections/listing-08-19/src/main.rs index fc08e9c..44b3b5b 100644 --- a/listings/ch08-common-collections/listing-08-19/src/main.rs +++ b/listings/ch08-common-collections/listing-08-19/src/main.rs @@ -1,6 +1,6 @@ fn main() { // ANCHOR: here - let s1 = String::from("hello"); + let s1 = String::from("hi"); let h = s1[0]; // ANCHOR_END: here } diff --git a/listings/ch08-common-collections/listing-08-20/Cargo.toml b/listings/ch08-common-collections/listing-08-20/Cargo.toml index fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 fe49598..fd85423 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 de65b05..c66cccc 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 660e2c8..94b8cff 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 5f4def0..2c92e13 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 c496db7..225a1e0 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 c496db7..225a1e0 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 b36bdc0..3ecc9c0 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 c496db7..225a1e0 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-05/src/main.rs b/listings/ch09-error-handling/listing-09-05/src/main.rs index e0bc55c..20f470b 100644 --- a/listings/ch09-error-handling/listing-09-05/src/main.rs +++ b/listings/ch09-error-handling/listing-09-05/src/main.rs @@ -11,8 +11,8 @@ fn main() { Ok(fc) => fc, Err(e) => panic!("Problem creating the file: {e:?}"), }, - other_error => { - panic!("Problem opening the file: {other_error:?}"); + _ => { + panic!("Problem opening the file: {error:?}"); } }, }; diff --git a/listings/ch09-error-handling/listing-09-06/Cargo.toml b/listings/ch09-error-handling/listing-09-06/Cargo.toml index c496db7..225a1e0 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 c496db7..225a1e0 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 c496db7..225a1e0 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 c496db7..225a1e0 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 c496db7..225a1e0 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-10/output.txt b/listings/ch09-error-handling/listing-09-10/output.txt index f3c1641..9e9b206 100644 --- a/listings/ch09-error-handling/listing-09-10/output.txt +++ b/listings/ch09-error-handling/listing-09-10/output.txt @@ -13,9 +13,7 @@ help: consider adding return type | 3 ~ fn main() -> Result<(), Box> { 4 | let greeting_file = File::open("hello.txt")?; -5 + -6 + Ok(()) -7 + } +5 + Ok(()) | For more information about this error, try `rustc --explain E0277`. diff --git a/listings/ch09-error-handling/listing-09-11/Cargo.toml b/listings/ch09-error-handling/listing-09-11/Cargo.toml index c496db7..225a1e0 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 c496db7..225a1e0 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 d508e95..9f9c4ac 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/listing-09-13/src/lib.rs b/listings/ch09-error-handling/listing-09-13/src/guessing_game.rs similarity index 100% rename from listings/ch09-error-handling/listing-09-13/src/lib.rs rename to listings/ch09-error-handling/listing-09-13/src/guessing_game.rs diff --git a/listings/ch09-error-handling/listing-09-13/src/main.rs b/listings/ch09-error-handling/listing-09-13/src/main.rs index cda3893..6c3e963 100644 --- a/listings/ch09-error-handling/listing-09-13/src/main.rs +++ b/listings/ch09-error-handling/listing-09-13/src/main.rs @@ -3,6 +3,8 @@ use rand::Rng; use std::cmp::Ordering; use std::io; +mod guessing_game; + fn main() { println!("Guess the number!"); 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 660e2c8..94b8cff 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 ced4ee7..4268ef1 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 c496db7..225a1e0 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 c496db7..225a1e0 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 c496db7..225a1e0 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 d508e95..9f9c4ac 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 05b96ca..54a8c62 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 46f46a7..789790b 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 46f46a7..789790b 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-13/src/lib.rs b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/src/lib.rs index c4c8332..cbf66ab 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/src/lib.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-13/src/lib.rs @@ -16,14 +16,14 @@ impl Summary for NewsArticle { } } -pub struct Tweet { +pub struct SocialPost { pub username: String, pub content: String, pub reply: bool, - pub retweet: bool, + pub repost: bool, } -impl Summary for Tweet { +impl Summary for SocialPost { fn summarize(&self) -> String { format!("{}: {}", self.username, self.content) } 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 46f46a7..789790b 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-14/src/lib.rs b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/src/lib.rs index fb59b84..d64ea00 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/src/lib.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/listing-10-14/src/lib.rs @@ -15,14 +15,14 @@ pub struct NewsArticle { impl Summary for NewsArticle {} -pub struct Tweet { +pub struct SocialPost { pub username: String, pub content: String, pub reply: bool, - pub retweet: bool, + pub repost: bool, } -impl Summary for Tweet { +impl Summary for SocialPost { fn summarize(&self) -> String { format!("{}: {}", self.username, self.content) } 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 bf41acd..c80cf87 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 489f809..a13293a 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 7668de1..c7b92f7 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 489f809..a13293a 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 fc9ff29..b1a24a4 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 489f809..a13293a 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 f2e6338..a8bc4ef 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 489f809..a13293a 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 e884752..a4b0049 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 46f46a7..789790b 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-01-calling-trait-method/src/lib.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/lib.rs index fa644ca..1036ff9 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/lib.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/lib.rs @@ -15,14 +15,14 @@ impl Summary for NewsArticle { } } -pub struct Tweet { +pub struct SocialPost { pub username: String, pub content: String, pub reply: bool, - pub retweet: bool, + pub repost: bool, } -impl Summary for Tweet { +impl Summary for SocialPost { fn summarize(&self) -> String { format!("{}: {}", self.username, self.content) } diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs index 0b51121..0363b3e 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-01-calling-trait-method/src/main.rs @@ -1,14 +1,14 @@ -use aggregator::{Summary, Tweet}; +use aggregator::{SocialPost, Summary}; fn main() { - let tweet = Tweet { + let post = SocialPost { username: String::from("horse_ebooks"), content: String::from( "of course, as you probably already know, people", ), reply: false, - retweet: false, + repost: false, }; - println!("1 new tweet: {}", tweet.summarize()); + println!("1 new social post: {}", post.summarize()); } 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 46f46a7..789790b 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-02-calling-default-impl/src/lib.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/lib.rs index b6f93a6..d0abd43 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/lib.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-02-calling-default-impl/src/lib.rs @@ -13,14 +13,14 @@ pub struct NewsArticle { impl Summary for NewsArticle {} -pub struct Tweet { +pub struct SocialPost { pub username: String, pub content: String, pub reply: bool, - pub retweet: bool, + pub repost: bool, } -impl Summary for Tweet { +impl Summary for SocialPost { fn summarize(&self) -> String { format!("{}: {}", self.username, self.content) } 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 46f46a7..789790b 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-03-default-impl-calls-other-methods/src/lib.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/lib.rs index 643906f..dac17fc 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/lib.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/lib.rs @@ -8,15 +8,15 @@ pub trait Summary { } // ANCHOR_END: here -pub struct Tweet { +pub struct SocialPost { pub username: String, pub content: String, pub reply: bool, - pub retweet: bool, + pub repost: bool, } // ANCHOR: impl -impl Summary for Tweet { +impl Summary for SocialPost { fn summarize_author(&self) -> String { format!("@{}", self.username) } diff --git a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs index e05e8e1..5247f78 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-03-default-impl-calls-other-methods/src/main.rs @@ -1,16 +1,16 @@ -use aggregator::{self, Summary, Tweet}; +use aggregator::{self, SocialPost, Summary}; fn main() { // ANCHOR: here - let tweet = Tweet { + let post = SocialPost { username: String::from("horse_ebooks"), content: String::from( "of course, as you probably already know, people", ), reply: false, - retweet: false, + repost: false, }; - println!("1 new tweet: {}", tweet.summarize()); + println!("1 new social post: {}", post.summarize()); // ANCHOR_END: here } 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 46f46a7..789790b 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-04-traits-as-parameters/src/lib.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/src/lib.rs index 2619943..18a8ddb 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/src/lib.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-04-traits-as-parameters/src/lib.rs @@ -15,14 +15,14 @@ impl Summary for NewsArticle { } } -pub struct Tweet { +pub struct SocialPost { pub username: String, pub content: String, pub reply: bool, - pub retweet: bool, + pub repost: bool, } -impl Summary for Tweet { +impl Summary for SocialPost { fn summarize(&self) -> String { format!("{}: {}", self.username, self.content) } 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 46f46a7..789790b 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-05-returning-impl-trait/src/lib.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/src/lib.rs index a611fce..a596c89 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/src/lib.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-05-returning-impl-trait/src/lib.rs @@ -15,14 +15,14 @@ impl Summary for NewsArticle { } } -pub struct Tweet { +pub struct SocialPost { pub username: String, pub content: String, pub reply: bool, - pub retweet: bool, + pub repost: bool, } -impl Summary for Tweet { +impl Summary for SocialPost { fn summarize(&self) -> String { format!("{}: {}", self.username, self.content) } @@ -30,13 +30,13 @@ impl Summary for Tweet { // ANCHOR: here fn returns_summarizable() -> impl Summary { - Tweet { + SocialPost { username: String::from("horse_ebooks"), content: String::from( "of course, as you probably already know, people", ), reply: false, - retweet: false, + repost: false, } } // ANCHOR_END: here 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 46f46a7..789790b 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-06-impl-trait-returns-one-type/src/lib.rs b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/src/lib.rs index 7cd81d4..a9ffbcd 100644 --- a/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/src/lib.rs +++ b/listings/ch10-generic-types-traits-and-lifetimes/no-listing-06-impl-trait-returns-one-type/src/lib.rs @@ -15,14 +15,14 @@ impl Summary for NewsArticle { } } -pub struct Tweet { +pub struct SocialPost { pub username: String, pub content: String, pub reply: bool, - pub retweet: bool, + pub repost: bool, } -impl Summary for Tweet { +impl Summary for SocialPost { fn summarize(&self) -> String { format!("{}: {}", self.username, self.content) } @@ -43,13 +43,13 @@ fn returns_summarizable(switch: bool) -> impl Summary { ), } } else { - Tweet { + SocialPost { username: String::from("horse_ebooks"), content: String::from( "of course, as you probably already know, people", ), reply: false, - retweet: false, + repost: false, } } } 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 4dbde90..44949be 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 489f809..a13293a 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 4b0201f..de3703f 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 b7d36d4..9a5826a 100644 --- a/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml +++ b/listings/ch11-writing-automated-tests/listing-11-01/Cargo.toml @@ -1,8 +1,6 @@ [package] name = "adder" version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +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 128309c..76e144c 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 (target/debug/deps/adder-92948b65e88960b4) + Running unittests src/lib.rs (target/debug/deps/adder-01ad14159ff659ab) running 1 test test tests::it_works ... ok diff --git a/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs b/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs index 7d12d9a..b93cf3f 100644 --- a/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs +++ b/listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs @@ -1,4 +1,4 @@ -pub fn add(left: usize, right: usize) -> usize { +pub fn add(left: u64, right: u64) -> u64 { left + right } 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 e61cb12..9a5826a 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 cf2c206..8302131 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-03/src/lib.rs b/listings/ch11-writing-automated-tests/listing-11-03/src/lib.rs index 866f023..336ea08 100644 --- a/listings/ch11-writing-automated-tests/listing-11-03/src/lib.rs +++ b/listings/ch11-writing-automated-tests/listing-11-03/src/lib.rs @@ -1,4 +1,4 @@ -pub fn add(left: usize, right: usize) -> usize { +pub fn add(left: u64, right: u64) -> u64 { left + right } 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 2447c67..7693d91 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 2447c67..7693d91 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 e61cb12..9a5826a 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 4e348c8..53e7b39 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 4e348c8..53e7b39 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 f751864..84052be 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 c67b607..6dc3371 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 e61cb12..9a5826a 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 e61cb12..9a5826a 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 e61cb12..9a5826a 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 e61cb12..9a5826a 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-01-changing-test-name/src/lib.rs b/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/src/lib.rs index 5be58b9..5014a76 100644 --- a/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/src/lib.rs +++ b/listings/ch11-writing-automated-tests/no-listing-01-changing-test-name/src/lib.rs @@ -1,4 +1,4 @@ -pub fn add(left: usize, right: usize) -> usize { +pub fn add(left: u64, right: u64) -> u64 { left + right } 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 2447c67..7693d91 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 2447c67..7693d91 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 6d616db..cd0d11a 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 e61cb12..9a5826a 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 927f891..ca853f5 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 90a826c..e1d7285 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 90a826c..e1d7285 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 0a7d44d..4aad221 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 90a826c..e1d7285 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 d2015d5..ac3044d 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 4e348c8..53e7b39 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 4e348c8..53e7b39 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 f30b55a..5198187 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 e61cb12..9a5826a 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-10-result-in-tests/src/lib.rs b/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs index c31cdca..06b1a03 100644 --- a/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs +++ b/listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs @@ -1,4 +1,4 @@ -pub fn add(left: usize, right: usize) -> usize { +pub fn add(left: u64, right: u64) -> u64 { left + right } 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 e61cb12..9a5826a 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-11-ignore-a-test/src/lib.rs b/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/src/lib.rs index c5f8867..05fbe1a 100644 --- a/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/src/lib.rs +++ b/listings/ch11-writing-automated-tests/no-listing-11-ignore-a-test/src/lib.rs @@ -1,4 +1,4 @@ -pub fn add(left: usize, right: usize) -> usize { +pub fn add(left: u64, right: u64) -> u64 { left + right } @@ -16,7 +16,7 @@ mod tests { #[test] #[ignore] fn expensive_test() { - // 需要运行一个小时的代码 + // code that takes an hour to run } } // ANCHOR_END: here 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 e61cb12..9a5826a 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 e61cb12..9a5826a 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 f751864..84052be 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 b6fa60d..b541a0d 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 e61cb12..9a5826a 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 e61cb12..9a5826a 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 e61cb12..9a5826a 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 e61cb12..9a5826a 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 e14b954..03ce351 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 64c2a3f..b8302ae 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 c1aa1a9..8617420 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 9f4c64d..c9c8f74 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 1eb392d..4f22291 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 f09a737..af49cfa 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 914c4cf..d2a312b 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 914c4cf..d2a312b 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 fbc00b5..fd33cb7 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 914c4cf..d2a312b 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 695ee4b..af22182 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 8085ade..e8f11bd 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 4a279a4..bd5e247 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 703c9d9..2331b52 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 4a279a4..bd5e247 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 2652a8a..4db0b0f 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 2652a8a..4db0b0f 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 2652a8a..4db0b0f 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 2652a8a..4db0b0f 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 2652a8a..4db0b0f 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 2652a8a..4db0b0f 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 cc80377..a6b4567 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 64c2a3f..b8302ae 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 c52da04..60664c6 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 c52da04..60664c6 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 66ef4b5..f16924b 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 66ef4b5..f16924b 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 66ef4b5..f16924b 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 66ef4b5..f16924b 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 51f3b76..4b6e112 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/Cargo.toml b/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.toml index 1448801..2bc25b7 100644 --- a/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.toml +++ b/listings/ch14-more-about-cargo/listing-14-07/add/Cargo.toml @@ -1,6 +1,3 @@ [workspace] - -members = [ - "adder", - "add_one", -] +resolver = "3" +members = ["adder", "add_one"] 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 8af4ab8..dcfb7f9 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 feb3d95..980d5bf 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/listing-14-07/add/adder/src/main.rs b/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs index 1316294..ead4e1d 100644 --- a/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs +++ b/listings/ch14-more-about-cargo/listing-14-07/add/adder/src/main.rs @@ -1,5 +1,3 @@ -use add_one; - fn main() { let num = 10; println!("Hello, world! {num} plus one is {}!", add_one::add_one(num)); diff --git a/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.toml deleted file mode 100644 index c5ea8e5..0000000 --- a/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -[workspace] - -members = [ - "adder", -] diff --git a/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/src/main.rs b/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/src/main.rs deleted file mode 100644 index e7a11a9..0000000 --- a/listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/adder/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -} diff --git a/listings/ch14-more-about-cargo/no-listing-01-workspace/add/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-01-workspace/add/Cargo.toml new file mode 100644 index 0000000..daa8c44 --- /dev/null +++ b/listings/ch14-more-about-cargo/no-listing-01-workspace/add/Cargo.toml @@ -0,0 +1,2 @@ +[workspace] +resolver = "3" diff --git a/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.toml index 1448801..2bc25b7 100644 --- a/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-02-workspace-with-two-crates/add/Cargo.toml @@ -1,6 +1,3 @@ [workspace] - -members = [ - "adder", - "add_one", -] +resolver = "3" +members = ["adder", "add_one"] 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 8af4ab8..dcfb7f9 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 55c0203..5f4a489 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/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.toml index 1448801..2bc25b7 100644 --- a/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-03-workspace-with-external-dependency/add/Cargo.toml @@ -1,6 +1,3 @@ [workspace] - -members = [ - "adder", - "add_one", -] +resolver = "3" +members = ["adder", "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 bc758bd..d399d96 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 feb3d95..980d5bf 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/Cargo.toml b/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.toml index 1448801..2bc25b7 100644 --- a/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.toml +++ b/listings/ch14-more-about-cargo/no-listing-04-workspace-with-tests/add/Cargo.toml @@ -1,6 +1,3 @@ [workspace] - -members = [ - "adder", - "add_one", -] +resolver = "3" +members = ["adder", "add_one"] 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 8af4ab8..dcfb7f9 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 feb3d95..980d5bf 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-01-adder-crate/add/Cargo.toml b/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.toml index c5ea8e5..448a038 100644 --- a/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.toml +++ b/listings/ch14-more-about-cargo/output-only-01-adder-crate/add/Cargo.toml @@ -1,5 +1,3 @@ [workspace] - -members = [ - "adder", -] +resolver = "3" +members = ["adder"] diff --git a/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml b/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml index 1448801..8d9f501 100644 --- a/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml +++ b/listings/ch14-more-about-cargo/output-only-02-add-one/add/Cargo.toml @@ -1,6 +1,3 @@ [workspace] - -members = [ - "adder", - "add_one", -] +resolver = "3" +members = [ "add_one","adder"] 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 9000184..dcfb7f9 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,8 +1,6 @@ [package] name = "add_one" version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +edition = "2024" [dependencies] diff --git a/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs b/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs index 7d12d9a..b93cf3f 100644 --- a/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs +++ b/listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs @@ -1,4 +1,4 @@ -pub fn add(left: usize, right: usize) -> usize { +pub fn add(left: u64, right: u64) -> u64 { left + right } 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 feb3d95..980d5bf 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/Cargo.toml b/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.toml index 1448801..2bc25b7 100644 --- a/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.toml +++ b/listings/ch14-more-about-cargo/output-only-03-use-rand/add/Cargo.toml @@ -1,6 +1,3 @@ [workspace] - -members = [ - "adder", - "add_one", -] +resolver = "3" +members = ["adder", "add_one"] 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 bc758bd..d399d96 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 feb3d95..980d5bf 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 690385c..f645b87 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 dce1515..d3f10bd 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 dce1515..d3f10bd 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 dce1515..d3f10bd 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 67ec198..bfefa23 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 67ec198..bfefa23 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 67ec198..bfefa23 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 67ec198..bfefa23 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 67ec198..bfefa23 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 67ec198..bfefa23 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 67ec198..bfefa23 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 67ec198..bfefa23 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 1e4c994..9b930b5 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 1e4c994..9b930b5 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 1e4c994..9b930b5 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 dce1515..d3f10bd 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 dce1515..d3f10bd 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 dce1515..d3f10bd 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 98c3f53..f5e2eb1 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 98c3f53..f5e2eb1 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-22/Cargo.toml b/listings/ch15-smart-pointers/listing-15-22/Cargo.toml index 98c3f53..f5e2eb1 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 98c3f53..f5e2eb1 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 d3e5602..7beebb3 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 dce1515..d3f10bd 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 dce1515..d3f10bd 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 dce1515..d3f10bd 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-26/src/main.rs b/listings/ch15-smart-pointers/listing-15-26/src/main.rs index 08963aa..1c81196 100644 --- a/listings/ch15-smart-pointers/listing-15-26/src/main.rs +++ b/listings/ch15-smart-pointers/listing-15-26/src/main.rs @@ -38,7 +38,7 @@ fn main() { println!("a rc count after changing a = {}", Rc::strong_count(&a)); // Uncomment the next line to see that we have a cycle; - // it will overflow the stack + // it will overflow the stack. // println!("a next item = {:?}", a.tail()); } // ANCHOR_END: here diff --git a/listings/ch15-smart-pointers/listing-15-27/Cargo.toml b/listings/ch15-smart-pointers/listing-15-27/Cargo.toml index 0bbf897..72a0e7c 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 0bbf897..72a0e7c 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 0bbf897..72a0e7c 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 16f9244..c172b53 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 67ec198..bfefa23 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/ch16-fearless-concurrency/listing-16-01/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-01/Cargo.toml index bd4edf7..f210198 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 bd4edf7..f210198 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 bd4edf7..f210198 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 bd4edf7..f210198 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 bd4edf7..f210198 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 24bd2ee..4bf22a4 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 24bd2ee..4bf22a4 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 24bd2ee..4bf22a4 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 24bd2ee..4bf22a4 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 24bd2ee..4bf22a4 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 24bd2ee..4bf22a4 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 da297ea..e777842 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 da297ea..e777842 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 da297ea..e777842 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 cc96bae..131fbed 100644 --- a/listings/ch16-fearless-concurrency/listing-16-14/output.txt +++ b/listings/ch16-fearless-concurrency/listing-16-14/output.txt @@ -15,14 +15,14 @@ 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` - --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:688:1 + --> /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/std/src/thread/mod.rs:728:1 For more information about this error, try `rustc --explain E0277`. error: could not compile `shared-state` (bin "shared-state") due to 1 previous error diff --git a/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml b/listings/ch16-fearless-concurrency/listing-16-15/Cargo.toml index da297ea..e777842 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 bd4edf7..f210198 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 da297ea..e777842 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 bd4edf7..f210198 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.lock b/listings/ch17-async-await/listing-17-01/Cargo.lock index 4ee6b7a..97939c9 100644 --- a/listings/ch17-async-await/listing-17-01/Cargo.lock +++ b/listings/ch17-async-await/listing-17-01/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -110,20 +104,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "core-foundation" -version = "0.9.4" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "cssparser" @@ -180,58 +164,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -375,31 +313,6 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -469,7 +382,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -495,22 +407,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -543,16 +440,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -580,12 +467,6 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -652,24 +533,7 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "windows-sys", ] [[package]] @@ -693,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -888,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -918,6 +732,55 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys", +] + [[package]] name = "quote" version = "1.0.37" @@ -974,38 +837,37 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1021,7 +883,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1031,17 +893,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.37" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1050,6 +905,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1089,15 +945,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1120,29 +967,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1249,7 +1073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1316,40 +1140,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1151,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1388,17 +1198,7 @@ dependencies = [ "mio", "pin-project-lite", "socket2", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "windows-sys", ] [[package]] @@ -1423,19 +1223,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1549,12 +1336,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1653,6 +1434,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1692,15 +1482,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" diff --git a/listings/ch17-async-await/listing-17-01/Cargo.toml b/listings/ch17-async-await/listing-17-01/Cargo.toml index 57fe49b..6155f0f 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.lock b/listings/ch17-async-await/listing-17-02/Cargo.lock index 9a37f62..28f8a84 100644 --- a/listings/ch17-async-await/listing-17-02/Cargo.lock +++ b/listings/ch17-async-await/listing-17-02/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -96,9 +90,9 @@ checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cc" -version = "1.1.19" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d74707dde2ba56f86ae90effb3b43ddd369504387e718014de010cec7959800" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "shlex", ] @@ -110,20 +104,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "core-foundation" -version = "0.9.4" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "cssparser" @@ -180,58 +164,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -375,31 +313,6 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -469,7 +382,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -495,22 +407,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -543,16 +440,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -580,12 +467,6 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -652,24 +533,7 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "windows-sys", ] [[package]] @@ -693,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -888,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -918,6 +732,55 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys", +] + [[package]] name = "quote" version = "1.0.37" @@ -974,54 +837,52 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] [[package]] name = "ring" -version = "0.17.8" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", "getrandom", "libc", - "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1031,17 +892,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.37" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1050,6 +904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1089,15 +944,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1120,29 +966,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1249,15 +1072,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -1316,40 +1133,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1144,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1388,17 +1191,7 @@ dependencies = [ "mio", "pin-project-lite", "socket2", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "windows-sys", ] [[package]] @@ -1423,19 +1216,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1549,12 +1329,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1653,6 +1427,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1692,15 +1475,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" diff --git a/listings/ch17-async-await/listing-17-02/Cargo.toml b/listings/ch17-async-await/listing-17-02/Cargo.toml index 57fe49b..6155f0f 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.lock b/listings/ch17-async-await/listing-17-03/Cargo.lock index 9a37f62..92c1ffe 100644 --- a/listings/ch17-async-await/listing-17-03/Cargo.lock +++ b/listings/ch17-async-await/listing-17-03/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -110,20 +104,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "core-foundation" -version = "0.9.4" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "cssparser" @@ -180,58 +164,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -375,31 +313,6 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -469,7 +382,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -495,22 +407,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -543,16 +440,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -580,12 +467,6 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -652,24 +533,7 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "windows-sys", ] [[package]] @@ -693,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -888,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -918,6 +732,55 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys", +] + [[package]] name = "quote" version = "1.0.37" @@ -974,38 +837,37 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1021,7 +883,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1031,17 +893,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.37" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1050,6 +905,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1089,15 +945,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1120,29 +967,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1249,7 +1073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1316,40 +1140,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1151,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1388,17 +1198,7 @@ dependencies = [ "mio", "pin-project-lite", "socket2", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "windows-sys", ] [[package]] @@ -1423,19 +1223,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1549,12 +1336,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1653,6 +1434,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1692,15 +1482,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" diff --git a/listings/ch17-async-await/listing-17-03/Cargo.toml b/listings/ch17-async-await/listing-17-03/Cargo.toml index 57fe49b..6155f0f 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.lock b/listings/ch17-async-await/listing-17-04/Cargo.lock index 9a37f62..92c1ffe 100644 --- a/listings/ch17-async-await/listing-17-04/Cargo.lock +++ b/listings/ch17-async-await/listing-17-04/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -110,20 +104,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "core-foundation" -version = "0.9.4" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "cssparser" @@ -180,58 +164,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -375,31 +313,6 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -469,7 +382,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -495,22 +407,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -543,16 +440,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -580,12 +467,6 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -652,24 +533,7 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "windows-sys", ] [[package]] @@ -693,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -888,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -918,6 +732,55 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys", +] + [[package]] name = "quote" version = "1.0.37" @@ -974,38 +837,37 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1021,7 +883,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1031,17 +893,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.37" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1050,6 +905,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1089,15 +945,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1120,29 +967,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1249,7 +1073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1316,40 +1140,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1151,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1388,17 +1198,7 @@ dependencies = [ "mio", "pin-project-lite", "socket2", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "windows-sys", ] [[package]] @@ -1423,19 +1223,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1549,12 +1336,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1653,6 +1434,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1692,15 +1482,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" diff --git a/listings/ch17-async-await/listing-17-04/Cargo.toml b/listings/ch17-async-await/listing-17-04/Cargo.toml index 57fe49b..6155f0f 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-04/output.txt b/listings/ch17-async-await/listing-17-04/output.txt deleted file mode 100644 index a9b7a86..0000000 --- a/listings/ch17-async-await/listing-17-04/output.txt +++ /dev/null @@ -1,3 +0,0 @@ -$ cargo run "http://www.rust-lang.org" -The title for http://www.rust-lang.org was - Rust Programming Language diff --git a/listings/ch17-async-await/listing-17-05/Cargo.lock b/listings/ch17-async-await/listing-17-05/Cargo.lock index 9a37f62..92c1ffe 100644 --- a/listings/ch17-async-await/listing-17-05/Cargo.lock +++ b/listings/ch17-async-await/listing-17-05/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -110,20 +104,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "core-foundation" -version = "0.9.4" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "cssparser" @@ -180,58 +164,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -375,31 +313,6 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -469,7 +382,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -495,22 +407,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -543,16 +440,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -580,12 +467,6 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -652,24 +533,7 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "windows-sys", ] [[package]] @@ -693,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -888,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -918,6 +732,55 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys", +] + [[package]] name = "quote" version = "1.0.37" @@ -974,38 +837,37 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1021,7 +883,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1031,17 +893,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.37" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1050,6 +905,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1089,15 +945,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1120,29 +967,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1249,7 +1073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1316,40 +1140,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1151,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1388,17 +1198,7 @@ dependencies = [ "mio", "pin-project-lite", "socket2", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "windows-sys", ] [[package]] @@ -1423,19 +1223,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1549,12 +1336,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1653,6 +1434,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1692,15 +1482,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" diff --git a/listings/ch17-async-await/listing-17-05/Cargo.toml b/listings/ch17-async-await/listing-17-05/Cargo.toml index 57fe49b..6155f0f 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.lock b/listings/ch17-async-await/listing-17-06/Cargo.lock index 0be7d2c..e3f560b 100644 --- a/listings/ch17-async-await/listing-17-06/Cargo.lock +++ b/listings/ch17-async-await/listing-17-06/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -540,16 +431,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -577,12 +458,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -651,23 +526,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -699,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -894,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -924,6 +732,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -980,38 +836,37 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1037,17 +892,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1056,6 +904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1095,15 +944,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1126,29 +966,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1316,40 +1133,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1144,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1392,16 +1195,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1424,19 +1217,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1550,12 +1330,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1654,6 +1428,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1702,15 +1485,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-06/Cargo.toml b/listings/ch17-async-await/listing-17-06/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-07/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-07/Cargo.lock +++ b/listings/ch17-async-await/listing-17-07/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-07/Cargo.toml b/listings/ch17-async-await/listing-17-07/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-08/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-08/Cargo.lock +++ b/listings/ch17-async-await/listing-17-08/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-08/Cargo.toml b/listings/ch17-async-await/listing-17-08/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-09/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-09/Cargo.lock +++ b/listings/ch17-async-await/listing-17-09/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-09/Cargo.toml b/listings/ch17-async-await/listing-17-09/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-10/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-10/Cargo.lock +++ b/listings/ch17-async-await/listing-17-10/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-10/Cargo.toml b/listings/ch17-async-await/listing-17-10/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-11/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-11/Cargo.lock +++ b/listings/ch17-async-await/listing-17-11/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-11/Cargo.toml b/listings/ch17-async-await/listing-17-11/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-12/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-12/Cargo.lock +++ b/listings/ch17-async-await/listing-17-12/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-12/Cargo.toml b/listings/ch17-async-await/listing-17-12/Cargo.toml index 349041d..10702bd 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-12/src/main.rs b/listings/ch17-async-await/listing-17-12/src/main.rs index c22b7d2..15cdf55 100644 --- a/listings/ch17-async-await/listing-17-12/src/main.rs +++ b/listings/ch17-async-await/listing-17-12/src/main.rs @@ -23,7 +23,7 @@ fn main() { let rx_fut = async { while let Some(value) = rx.recv().await { - eprintln!("received '{value}'"); + println!("received '{value}'"); } }; diff --git a/listings/ch17-async-await/listing-17-13/Cargo.lock b/listings/ch17-async-await/listing-17-13/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-13/Cargo.lock +++ b/listings/ch17-async-await/listing-17-13/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-13/Cargo.toml b/listings/ch17-async-await/listing-17-13/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-14/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-14/Cargo.lock +++ b/listings/ch17-async-await/listing-17-14/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-14/Cargo.toml b/listings/ch17-async-await/listing-17-14/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-15/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-15/Cargo.lock +++ b/listings/ch17-async-await/listing-17-15/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-15/Cargo.toml b/listings/ch17-async-await/listing-17-15/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-16/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-16/Cargo.lock +++ b/listings/ch17-async-await/listing-17-16/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-16/Cargo.toml b/listings/ch17-async-await/listing-17-16/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-17/Cargo.lock index 973206d..7dc48e0 100644 --- a/listings/ch17-async-await/listing-17-17/Cargo.lock +++ b/listings/ch17-async-await/listing-17-17/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-17/Cargo.toml b/listings/ch17-async-await/listing-17-17/Cargo.toml index 349041d..10702bd 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-17/src/main.rs b/listings/ch17-async-await/listing-17-17/src/main.rs index 1888a53..b58c749 100644 --- a/listings/ch17-async-await/listing-17-17/src/main.rs +++ b/listings/ch17-async-await/listing-17-17/src/main.rs @@ -1,6 +1,6 @@ extern crate trpl; // required for mdbook test -use std::{future::Future, time::Duration}; +use std::time::Duration; fn main() { trpl::run(async { diff --git a/listings/ch17-async-await/listing-17-18/Cargo.lock b/listings/ch17-async-await/listing-17-18/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-18/Cargo.lock +++ b/listings/ch17-async-await/listing-17-18/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-18/Cargo.toml b/listings/ch17-async-await/listing-17-18/Cargo.toml index 349041d..10702bd 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 7773660..37c0c16 100644 --- a/listings/ch17-async-await/listing-17-18/src/main.rs +++ b/listings/ch17-async-await/listing-17-18/src/main.rs @@ -1,17 +1,19 @@ extern crate trpl; // required for mdbook test -use std::{ - future::Future, - pin::{pin, Pin}, - time::Duration, -}; +// ANCHOR: here +use std::pin::Pin; + +// -- snip -- + +// ANCHOR_END: here +use std::time::Duration; fn main() { trpl::run(async { let (tx, mut rx) = trpl::channel(); let tx1 = tx.clone(); - let tx1_fut = pin!(async move { + let tx1_fut = async move { let vals = vec![ String::from("hi"), String::from("from"), @@ -23,15 +25,15 @@ fn main() { tx1.send(val).unwrap(); trpl::sleep(Duration::from_secs(1)).await; } - }); + }; - let rx_fut = pin!(async { + let rx_fut = async { while let Some(value) = rx.recv().await { println!("received '{value}'"); } - }); + }; - let tx_fut = pin!(async move { + let tx_fut = async move { let vals = vec![ String::from("more"), String::from("messages"), @@ -43,7 +45,7 @@ fn main() { tx.send(val).unwrap(); trpl::sleep(Duration::from_secs(1)).await; } - }); + }; // ANCHOR: here let futures: Vec>>> = diff --git a/listings/ch17-async-await/listing-17-19/Cargo.lock b/listings/ch17-async-await/listing-17-19/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-19/Cargo.lock +++ b/listings/ch17-async-await/listing-17-19/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-19/Cargo.toml b/listings/ch17-async-await/listing-17-19/Cargo.toml index 349041d..10702bd 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/output.txt b/listings/ch17-async-await/listing-17-19/output.txt deleted file mode 100644 index f6a657d..0000000 --- a/listings/ch17-async-await/listing-17-19/output.txt +++ /dev/null @@ -1,14 +0,0 @@ -$ cargo run -error: failed to get `trpl` as a dependency of package `async_await v0.1.0 (/Users/chris/dev/rust-lang/book/tmp/listings/ch17-async-await/listing-17-18)` - -Caused by: - failed to load source for dependency `trpl` - -Caused by: - Unable to update /Users/chris/dev/rust-lang/book/tmp/packages/trpl - -Caused by: - failed to read `/Users/chris/dev/rust-lang/book/tmp/packages/trpl/Cargo.toml` - -Caused by: - No such file or directory (os error 2) 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 41820fc..1133c64 100644 --- a/listings/ch17-async-await/listing-17-19/src/main.rs +++ b/listings/ch17-async-await/listing-17-19/src/main.rs @@ -1,10 +1,12 @@ extern crate trpl; // required for mdbook test -use std::{ - future::Future, - pin::{pin, Pin}, - time::Duration, -}; +// ANCHOR: here +use std::pin::{Pin, pin}; + +// -- snip -- + +// ANCHOR_END: here +use std::time::Duration; fn main() { trpl::run(async { diff --git a/listings/ch17-async-await/listing-17-20/Cargo.lock b/listings/ch17-async-await/listing-17-20/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-20/Cargo.lock +++ b/listings/ch17-async-await/listing-17-20/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-20/Cargo.toml b/listings/ch17-async-await/listing-17-20/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-21/Cargo.lock index 3459819..00a8257 100644 --- a/listings/ch17-async-await/listing-17-21/Cargo.lock +++ b/listings/ch17-async-await/listing-17-21/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.2" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-21/Cargo.toml b/listings/ch17-async-await/listing-17-21/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-22/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-22/Cargo.lock +++ b/listings/ch17-async-await/listing-17-22/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-22/Cargo.toml b/listings/ch17-async-await/listing-17-22/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-23/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-23/Cargo.lock +++ b/listings/ch17-async-await/listing-17-23/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-23/Cargo.toml b/listings/ch17-async-await/listing-17-23/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-24/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-24/Cargo.lock +++ b/listings/ch17-async-await/listing-17-24/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-24/Cargo.toml b/listings/ch17-async-await/listing-17-24/Cargo.toml index 349041d..10702bd 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-24/src/main.rs b/listings/ch17-async-await/listing-17-24/src/main.rs index 961431d..2f8310f 100644 --- a/listings/ch17-async-await/listing-17-24/src/main.rs +++ b/listings/ch17-async-await/listing-17-24/src/main.rs @@ -26,7 +26,7 @@ fn main() { trpl::sleep(one_ms).await; slow("b", 15); trpl::sleep(one_ms).await; - slow("b", 35); + slow("b", 350); trpl::sleep(one_ms).await; println!("'b' finished."); }; diff --git a/listings/ch17-async-await/listing-17-25/Cargo.lock b/listings/ch17-async-await/listing-17-25/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-25/Cargo.lock +++ b/listings/ch17-async-await/listing-17-25/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-25/Cargo.toml b/listings/ch17-async-await/listing-17-25/Cargo.toml index 349041d..10702bd 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-25/src/main.rs b/listings/ch17-async-await/listing-17-25/src/main.rs index 1650221..40ebb8c 100644 --- a/listings/ch17-async-await/listing-17-25/src/main.rs +++ b/listings/ch17-async-await/listing-17-25/src/main.rs @@ -24,7 +24,7 @@ fn main() { trpl::yield_now().await; slow("b", 15); trpl::yield_now().await; - slow("b", 35); + slow("b", 350); trpl::yield_now().await; println!("'b' finished."); }; diff --git a/listings/ch17-async-await/listing-17-26/Cargo.lock b/listings/ch17-async-await/listing-17-26/Cargo.lock index 3459819..00a8257 100644 --- a/listings/ch17-async-await/listing-17-26/Cargo.lock +++ b/listings/ch17-async-await/listing-17-26/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.2" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-26/Cargo.toml b/listings/ch17-async-await/listing-17-26/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-27/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-27/Cargo.lock +++ b/listings/ch17-async-await/listing-17-27/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-27/Cargo.toml b/listings/ch17-async-await/listing-17-27/Cargo.toml index 349041d..10702bd 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.lock b/listings/ch17-async-await/listing-17-28/Cargo.lock index f09d291..7efd72f 100644 --- a/listings/ch17-async-await/listing-17-28/Cargo.lock +++ b/listings/ch17-async-await/listing-17-28/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-28/Cargo.toml b/listings/ch17-async-await/listing-17-28/Cargo.toml index 349041d..10702bd 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-28/src/main.rs b/listings/ch17-async-await/listing-17-28/src/main.rs index d2edded..8c6348c 100644 --- a/listings/ch17-async-await/listing-17-28/src/main.rs +++ b/listings/ch17-async-await/listing-17-28/src/main.rs @@ -1,6 +1,6 @@ extern crate trpl; // required for mdbook test -use std::{future::Future, time::Duration}; +use std::time::Duration; fn main() { trpl::run(async { diff --git a/listings/ch17-async-await/listing-17-29/Cargo.lock b/listings/ch17-async-await/listing-17-29/Cargo.lock index 0be7d2c..e3f560b 100644 --- a/listings/ch17-async-await/listing-17-29/Cargo.lock +++ b/listings/ch17-async-await/listing-17-29/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -540,16 +431,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -577,12 +458,6 @@ version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -651,23 +526,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -699,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -894,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -924,6 +732,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -980,38 +836,37 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1037,17 +892,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1056,6 +904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1095,15 +944,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1126,29 +966,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1316,40 +1133,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1144,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1392,16 +1195,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1424,19 +1217,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1550,12 +1330,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1654,6 +1428,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1702,15 +1485,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-29/Cargo.toml b/listings/ch17-async-await/listing-17-29/Cargo.toml index 349041d..10702bd 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-29/src/main.rs b/listings/ch17-async-await/listing-17-29/src/main.rs index 9efb5e7..510cbd3 100644 --- a/listings/ch17-async-await/listing-17-29/src/main.rs +++ b/listings/ch17-async-await/listing-17-29/src/main.rs @@ -1,6 +1,6 @@ extern crate trpl; // required for mdbook test -use std::{future::Future, time::Duration}; +use std::time::Duration; // ANCHOR: implementation use trpl::Either; diff --git a/listings/ch17-async-await/listing-17-30/Cargo.lock b/listings/ch17-async-await/listing-17-30/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-30/Cargo.lock +++ b/listings/ch17-async-await/listing-17-30/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-30/Cargo.toml b/listings/ch17-async-await/listing-17-30/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-31/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-31/Cargo.lock +++ b/listings/ch17-async-await/listing-17-31/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-31/Cargo.toml b/listings/ch17-async-await/listing-17-31/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-32/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-32/Cargo.lock +++ b/listings/ch17-async-await/listing-17-32/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-32/Cargo.toml b/listings/ch17-async-await/listing-17-32/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-33/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-33/Cargo.lock +++ b/listings/ch17-async-await/listing-17-33/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-33/Cargo.toml b/listings/ch17-async-await/listing-17-33/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-34/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-34/Cargo.lock +++ b/listings/ch17-async-await/listing-17-34/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-34/Cargo.toml b/listings/ch17-async-await/listing-17-34/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-35/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-35/Cargo.lock +++ b/listings/ch17-async-await/listing-17-35/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-35/Cargo.toml b/listings/ch17-async-await/listing-17-35/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-36/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-36/Cargo.lock +++ b/listings/ch17-async-await/listing-17-36/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-36/Cargo.toml b/listings/ch17-async-await/listing-17-36/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-37/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-37/Cargo.lock +++ b/listings/ch17-async-await/listing-17-37/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-37/Cargo.toml b/listings/ch17-async-await/listing-17-37/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-38/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-38/Cargo.lock +++ b/listings/ch17-async-await/listing-17-38/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-38/Cargo.toml b/listings/ch17-async-await/listing-17-38/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-39/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-39/Cargo.lock +++ b/listings/ch17-async-await/listing-17-39/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-39/Cargo.toml b/listings/ch17-async-await/listing-17-39/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-40/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-40/Cargo.lock +++ b/listings/ch17-async-await/listing-17-40/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-40/Cargo.toml b/listings/ch17-async-await/listing-17-40/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-41/Cargo.lock index 72e870c..1a59804 100644 --- a/listings/ch17-async-await/listing-17-41/Cargo.lock +++ b/listings/ch17-async-await/listing-17-41/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -539,16 +430,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -576,12 +457,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -650,23 +525,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -698,50 +556,6 @@ version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -873,12 +687,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -903,6 +711,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -959,38 +815,37 @@ checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1016,17 +871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1035,6 +883,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1073,15 +922,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1104,29 +944,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1294,40 +1111,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1339,6 +1122,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1370,16 +1173,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1402,19 +1195,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower-service" version = "0.3.3" @@ -1507,12 +1287,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1611,6 +1385,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1659,15 +1442,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-41/Cargo.toml b/listings/ch17-async-await/listing-17-41/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/listing-17-42/Cargo.lock index 071a094..0c240d2 100644 --- a/listings/ch17-async-await/listing-17-42/Cargo.lock +++ b/listings/ch17-async-await/listing-17-42/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -106,22 +100,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cssparser" version = "0.31.2" @@ -177,58 +155,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -372,31 +304,6 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -466,7 +373,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -492,22 +398,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -540,16 +431,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -577,12 +458,6 @@ version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -651,23 +526,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -699,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -894,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -924,6 +732,54 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -980,38 +836,37 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1037,17 +892,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.34" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1056,6 +904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1095,15 +944,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1126,29 +966,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1316,40 +1133,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1144,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1392,16 +1195,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" @@ -1424,19 +1217,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1550,12 +1330,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1654,6 +1428,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1702,15 +1485,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-targets" version = "0.48.5" diff --git a/listings/ch17-async-await/listing-17-42/Cargo.toml b/listings/ch17-async-await/listing-17-42/Cargo.toml index e094f06..e5c8a84 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.lock b/listings/ch17-async-await/no-listing-state-machine/Cargo.lock index 7b6b110..97939c9 100644 --- a/listings/ch17-async-await/no-listing-state-machine/Cargo.lock +++ b/listings/ch17-async-await/no-listing-state-machine/Cargo.lock @@ -37,12 +37,6 @@ dependencies = [ "trpl", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.3.0" @@ -110,20 +104,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "core-foundation" -version = "0.9.4" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "cssparser" @@ -180,58 +164,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" -[[package]] -name = "encoding_rs" -version = "0.8.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "fastrand" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -375,31 +313,6 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - [[package]] name = "hermit-abi" version = "0.3.9" @@ -469,7 +382,6 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2", "http", "http-body", "httparse", @@ -495,22 +407,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", + "webpki-roots", ] [[package]] @@ -543,16 +440,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" -dependencies = [ - "equivalent", - "hashbrown", -] - [[package]] name = "ipnet" version = "2.10.0" @@ -580,12 +467,6 @@ version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lock_api" version = "0.4.12" @@ -652,24 +533,7 @@ dependencies = [ "hermit-abi", "libc", "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "windows-sys", ] [[package]] @@ -693,50 +557,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "openssl" -version = "0.10.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.103" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -888,12 +708,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -918,6 +732,55 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys", +] + [[package]] name = "quote" version = "1.0.37" @@ -974,38 +837,37 @@ checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pemfile", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "windows-registry", ] @@ -1021,7 +883,7 @@ dependencies = [ "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1031,17 +893,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustix" -version = "0.38.37" +name = "rustc-hash" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustls" @@ -1050,6 +905,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1089,15 +945,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "schannel" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "scopeguard" version = "1.2.0" @@ -1120,29 +967,6 @@ dependencies = [ "tendril", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "selectors" version = "0.25.0" @@ -1249,7 +1073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1316,40 +1140,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "tempfile" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "tendril" version = "0.4.3" @@ -1361,6 +1151,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "thiserror" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -1388,17 +1198,7 @@ dependencies = [ "mio", "pin-project-lite", "socket2", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "windows-sys", ] [[package]] @@ -1423,19 +1223,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "tower" version = "0.4.13" @@ -1549,12 +1336,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -1653,6 +1434,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "windows-registry" version = "0.2.0" @@ -1692,15 +1482,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" 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 e094f06..e5c8a84 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 67729af..12171e3 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 aed614e..af2ec97 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 aed614e..af2ec97 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 9b816e7..ac8282d 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 9b816e7..ac8282d 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 9b816e7..ac8282d 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 9b816e7..ac8282d 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 9b816e7..ac8282d 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 9b816e7..ac8282d 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 9b816e7..ac8282d 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 9b816e7..ac8282d 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 1619af5..790832e 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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-09/Cargo.toml b/listings/ch19-patterns-and-matching/listing-19-09/Cargo.toml index 82fe057..7e32476 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-09/src/main.rs b/listings/ch19-patterns-and-matching/listing-19-09/src/main.rs index e378c37..e974935 100644 --- a/listings/ch19-patterns-and-matching/listing-19-09/src/main.rs +++ b/listings/ch19-patterns-and-matching/listing-19-09/src/main.rs @@ -1,8 +1,8 @@ fn main() { let some_option_value: Option = None; // ANCHOR: here - if let Some(x) = some_option_value { - println!("{x}"); - } + let Some(x) = some_option_value else { + return; + }; // ANCHOR_END: here } 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 82fe057..7e32476 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-10/output.txt b/listings/ch19-patterns-and-matching/listing-19-10/output.txt index 97bc014..7f825dc 100644 --- a/listings/ch19-patterns-and-matching/listing-19-10/output.txt +++ b/listings/ch19-patterns-and-matching/listing-19-10/output.txt @@ -1,16 +1,15 @@ $ cargo run Compiling patterns v0.1.0 (file:///projects/patterns) -warning: irrefutable `if let` pattern - --> src/main.rs:2:8 +warning: irrefutable `let...else` pattern + --> src/main.rs:2:5 | -2 | if let x = 5 { - | ^^^^^^^^^ +2 | let x = 5 else { + | ^^^^^^^^^ | - = note: this pattern will always match, so the `if let` is useless - = help: consider replacing the `if let` with a `let` + = note: this pattern will always match, so the `else` clause is useless + = help: consider removing the `else` clause = note: `#[warn(irrefutable_let_patterns)]` on by default warning: `patterns` (bin "patterns") generated 1 warning Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.39s Running `target/debug/patterns` -5 diff --git a/listings/ch19-patterns-and-matching/listing-19-10/src/main.rs b/listings/ch19-patterns-and-matching/listing-19-10/src/main.rs index 2073948..6186890 100644 --- a/listings/ch19-patterns-and-matching/listing-19-10/src/main.rs +++ b/listings/ch19-patterns-and-matching/listing-19-10/src/main.rs @@ -1,7 +1,7 @@ fn main() { // ANCHOR: here - if let x = 5 { - println!("{x}"); + let x = 5 else { + return; }; // ANCHOR_END: here } 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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-15/src/main.rs b/listings/ch19-patterns-and-matching/listing-19-15/src/main.rs index 9407cc1..65ff116 100644 --- a/listings/ch19-patterns-and-matching/listing-19-15/src/main.rs +++ b/listings/ch19-patterns-and-matching/listing-19-15/src/main.rs @@ -19,7 +19,7 @@ fn main() { println!("Text message: {text}"); } Message::ChangeColor(r, g, b) => { - println!("Change the color to red {r}, green {g}, and blue {b}") + println!("Change color to red {r}, green {g}, and blue {b}"); } } } 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 82fe057..7e32476 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-16/src/main.rs b/listings/ch19-patterns-and-matching/listing-19-16/src/main.rs index 1e7ad5f..a31eeff 100644 --- a/listings/ch19-patterns-and-matching/listing-19-16/src/main.rs +++ b/listings/ch19-patterns-and-matching/listing-19-16/src/main.rs @@ -18,7 +18,7 @@ fn main() { println!("Change color to red {r}, green {g}, and blue {b}"); } Message::ChangeColor(Color::Hsv(h, s, v)) => { - println!("Change color to hue {h}, saturation {s}, value {v}") + println!("Change color to hue {h}, saturation {s}, value {v}"); } _ => (), } 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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-19/src/main.rs b/listings/ch19-patterns-and-matching/listing-19-19/src/main.rs index e28dab1..43220b8 100644 --- a/listings/ch19-patterns-and-matching/listing-19-19/src/main.rs +++ b/listings/ch19-patterns-and-matching/listing-19-19/src/main.rs @@ -4,7 +4,7 @@ fn main() { match numbers { (first, _, third, _, fifth) => { - println!("Some numbers: {first}, {third}, {fifth}") + println!("Some numbers: {first}, {third}, {fifth}"); } } // ANCHOR_END: here 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 82fe057..7e32476 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 3e8a292..690cfbd 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-01/src/main.rs b/listings/ch20-advanced-features/listing-20-01/src/main.rs index 893f578..492b43b 100644 --- a/listings/ch20-advanced-features/listing-20-01/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-01/src/main.rs @@ -2,7 +2,7 @@ fn main() { // ANCHOR: here let mut num = 5; - let r1 = &num as *const i32; - let r2 = &mut num as *mut i32; + let r1 = &raw const num; + let r2 = &raw mut num; // ANCHOR_END: here } diff --git a/listings/ch20-advanced-features/listing-20-02/Cargo.toml b/listings/ch20-advanced-features/listing-20-02/Cargo.toml index 3e8a292..690cfbd 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 3e8a292..690cfbd 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-03/src/main.rs b/listings/ch20-advanced-features/listing-20-03/src/main.rs index 02a0be6..6ed8ca2 100644 --- a/listings/ch20-advanced-features/listing-20-03/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-03/src/main.rs @@ -2,8 +2,8 @@ fn main() { // ANCHOR: here let mut num = 5; - let r1 = &num as *const i32; - let r2 = &mut num as *mut i32; + let r1 = &raw const num; + let r2 = &raw mut num; unsafe { println!("r1 is: {}", *r1); diff --git a/listings/ch20-advanced-features/listing-20-04/Cargo.toml b/listings/ch20-advanced-features/listing-20-04/Cargo.toml index 3e8a292..690cfbd 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 3e8a292..690cfbd 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 3e8a292..690cfbd 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 3e8a292..690cfbd 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 3e8a292..690cfbd 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-08/src/main.rs b/listings/ch20-advanced-features/listing-20-08/src/main.rs index 8b56630..90c183a 100644 --- a/listings/ch20-advanced-features/listing-20-08/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-08/src/main.rs @@ -1,4 +1,4 @@ -extern "C" { +unsafe extern "C" { fn abs(input: i32) -> i32; } diff --git a/listings/ch20-advanced-features/listing-20-09/Cargo.toml b/listings/ch20-advanced-features/listing-20-09/Cargo.toml index 3e8a292..690cfbd 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-09/src/main.rs b/listings/ch20-advanced-features/listing-20-09/src/main.rs index fda5179..7d77d51 100644 --- a/listings/ch20-advanced-features/listing-20-09/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-09/src/main.rs @@ -1,5 +1,7 @@ -static HELLO_WORLD: &str = "Hello, world!"; +unsafe extern "C" { + safe fn abs(input: i32) -> i32; +} fn main() { - println!("name is: {HELLO_WORLD}"); + println!("Absolute value of -3 according to C: {}", abs(-3)); } diff --git a/listings/ch20-advanced-features/listing-20-10/Cargo.toml b/listings/ch20-advanced-features/listing-20-10/Cargo.toml index 3e8a292..690cfbd 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-10/src/main.rs b/listings/ch20-advanced-features/listing-20-10/src/main.rs index b5559fd..fda5179 100644 --- a/listings/ch20-advanced-features/listing-20-10/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-10/src/main.rs @@ -1,15 +1,5 @@ -static mut COUNTER: u32 = 0; - -fn add_to_count(inc: u32) { - unsafe { - COUNTER += inc; - } -} +static HELLO_WORLD: &str = "Hello, world!"; fn main() { - add_to_count(3); - - unsafe { - println!("COUNTER: {COUNTER}"); - } + println!("name is: {HELLO_WORLD}"); } diff --git a/listings/ch20-advanced-features/listing-20-11/Cargo.toml b/listings/ch20-advanced-features/listing-20-11/Cargo.toml index 3e8a292..690cfbd 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 new file mode 100644 index 0000000..bf64b38 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-11/output.txt @@ -0,0 +1,5 @@ +$ 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 `file:///home/.rustup/toolchains/nightly/bin/cargo-miri runner target/miri/debug/unsafe-example` +COUNTER: 3 diff --git a/listings/ch20-advanced-features/listing-20-11/src/main.rs b/listings/ch20-advanced-features/listing-20-11/src/main.rs index 885c1aa..4e292b1 100644 --- a/listings/ch20-advanced-features/listing-20-11/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-11/src/main.rs @@ -1,9 +1,18 @@ -unsafe trait Foo { - // methods go here +static mut COUNTER: u32 = 0; + +/// SAFETY: Calling this from more than a single thread at a time is undefined +/// behavior, so you *must* guarantee you only call it from a single thread at +/// a time. +unsafe fn add_to_count(inc: u32) { + unsafe { + COUNTER += inc; + } } -unsafe impl Foo for i32 { - // method implementations go here +fn main() { + unsafe { + // SAFETY: This is only called from a single thread in `main`. + add_to_count(3); + println!("COUNTER: {}", *(&raw const COUNTER)); + } } - -fn main() {} diff --git a/listings/ch20-advanced-features/listing-20-12/Cargo.lock b/listings/ch20-advanced-features/listing-20-12/Cargo.lock index b1977d0..497817b 100644 --- a/listings/ch20-advanced-features/listing-20-12/Cargo.lock +++ b/listings/ch20-advanced-features/listing-20-12/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "traits-example" +name = "unsafe-example" version = "0.1.0" diff --git a/listings/ch20-advanced-features/listing-20-12/Cargo.toml b/listings/ch20-advanced-features/listing-20-12/Cargo.toml index 52395a5..690cfbd 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 = "traits-example" +name = "unsafe-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-12/src/lib.rs b/listings/ch20-advanced-features/listing-20-12/src/lib.rs deleted file mode 100644 index dbe0462..0000000 --- a/listings/ch20-advanced-features/listing-20-12/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub trait Iterator { - type Item; - - fn next(&mut self) -> Option; -} diff --git a/listings/ch20-advanced-features/listing-20-12/src/main.rs b/listings/ch20-advanced-features/listing-20-12/src/main.rs new file mode 100644 index 0000000..2301b0c --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-12/src/main.rs @@ -0,0 +1,11 @@ +// ANCHOR: here +unsafe trait Foo { + // methods go here +} + +unsafe impl Foo for i32 { + // method implementations go here +} +// ANCHOR_END: here + +fn main() {} diff --git a/listings/ch20-advanced-features/listing-20-13/Cargo.toml b/listings/ch20-advanced-features/listing-20-13/Cargo.toml index 52395a5..9c48a44 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-13/src/lib.rs b/listings/ch20-advanced-features/listing-20-13/src/lib.rs index 7c9479c..dbe0462 100644 --- a/listings/ch20-advanced-features/listing-20-13/src/lib.rs +++ b/listings/ch20-advanced-features/listing-20-13/src/lib.rs @@ -1,3 +1,5 @@ -pub trait Iterator { - fn next(&mut self) -> Option; +pub trait Iterator { + type Item; + + fn next(&mut self) -> Option; } diff --git a/listings/ch20-advanced-features/listing-20-14/Cargo.toml b/listings/ch20-advanced-features/listing-20-14/Cargo.toml index 52395a5..9c48a44 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-14/src/lib.rs b/listings/ch20-advanced-features/listing-20-14/src/lib.rs new file mode 100644 index 0000000..7c9479c --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-14/src/lib.rs @@ -0,0 +1,3 @@ +pub trait Iterator { + fn next(&mut self) -> Option; +} diff --git a/listings/ch20-advanced-features/listing-20-15/Cargo.toml b/listings/ch20-advanced-features/listing-20-15/Cargo.toml index 52395a5..9c48a44 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-14/src/main.rs b/listings/ch20-advanced-features/listing-20-15/src/main.rs similarity index 100% rename from listings/ch20-advanced-features/listing-20-14/src/main.rs rename to listings/ch20-advanced-features/listing-20-15/src/main.rs diff --git a/listings/ch20-advanced-features/listing-20-16/Cargo.toml b/listings/ch20-advanced-features/listing-20-16/Cargo.toml index 52395a5..9c48a44 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-15/src/lib.rs b/listings/ch20-advanced-features/listing-20-16/src/lib.rs similarity index 100% rename from listings/ch20-advanced-features/listing-20-15/src/lib.rs rename to listings/ch20-advanced-features/listing-20-16/src/lib.rs diff --git a/listings/ch20-advanced-features/listing-20-16/src/main.rs b/listings/ch20-advanced-features/listing-20-16/src/main.rs deleted file mode 100644 index d854e28..0000000 --- a/listings/ch20-advanced-features/listing-20-16/src/main.rs +++ /dev/null @@ -1,31 +0,0 @@ -// ANCHOR: here -trait Pilot { - fn fly(&self); -} - -trait Wizard { - fn fly(&self); -} - -struct Human; - -impl Pilot for Human { - fn fly(&self) { - println!("This is your captain speaking."); - } -} - -impl Wizard for Human { - fn fly(&self) { - println!("Up!"); - } -} - -impl Human { - fn fly(&self) { - println!("*waving arms furiously*"); - } -} -// ANCHOR_END: here - -fn main() {} diff --git a/listings/ch20-advanced-features/listing-20-17/Cargo.toml b/listings/ch20-advanced-features/listing-20-17/Cargo.toml index 52395a5..9c48a44 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-17/src/main.rs b/listings/ch20-advanced-features/listing-20-17/src/main.rs index 3df65a7..d854e28 100644 --- a/listings/ch20-advanced-features/listing-20-17/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-17/src/main.rs @@ -1,3 +1,4 @@ +// ANCHOR: here trait Pilot { fn fly(&self); } @@ -25,10 +26,6 @@ impl Human { println!("*waving arms furiously*"); } } - -// ANCHOR: here -fn main() { - let person = Human; - person.fly(); -} // ANCHOR_END: here + +fn main() {} diff --git a/listings/ch20-advanced-features/listing-20-18/Cargo.toml b/listings/ch20-advanced-features/listing-20-18/Cargo.toml index 52395a5..9c48a44 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-18/src/main.rs b/listings/ch20-advanced-features/listing-20-18/src/main.rs index fa01c09..3df65a7 100644 --- a/listings/ch20-advanced-features/listing-20-18/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-18/src/main.rs @@ -29,8 +29,6 @@ impl Human { // ANCHOR: here fn main() { let person = Human; - Pilot::fly(&person); - Wizard::fly(&person); person.fly(); } // ANCHOR_END: here diff --git a/listings/ch20-advanced-features/listing-20-19/Cargo.toml b/listings/ch20-advanced-features/listing-20-19/Cargo.toml index 52395a5..9c48a44 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-19/output.txt b/listings/ch20-advanced-features/listing-20-19/output.txt index b6e283f..d7e315b 100644 --- a/listings/ch20-advanced-features/listing-20-19/output.txt +++ b/listings/ch20-advanced-features/listing-20-19/output.txt @@ -1,5 +1,7 @@ $ cargo run Compiling traits-example v0.1.0 (file:///projects/traits-example) - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.54s + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.46s Running `target/debug/traits-example` -A baby dog is called a Spot +This is your captain speaking. +Up! +*waving arms furiously* diff --git a/listings/ch20-advanced-features/listing-20-19/src/main.rs b/listings/ch20-advanced-features/listing-20-19/src/main.rs index 44affe0..fa01c09 100644 --- a/listings/ch20-advanced-features/listing-20-19/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-19/src/main.rs @@ -1,21 +1,36 @@ -trait Animal { - fn baby_name() -> String; +trait Pilot { + fn fly(&self); } -struct Dog; +trait Wizard { + fn fly(&self); +} -impl Dog { - fn baby_name() -> String { - String::from("Spot") +struct Human; + +impl Pilot for Human { + fn fly(&self) { + println!("This is your captain speaking."); } } -impl Animal for Dog { - fn baby_name() -> String { - String::from("puppy") +impl Wizard for Human { + fn fly(&self) { + println!("Up!"); } } +impl Human { + fn fly(&self) { + println!("*waving arms furiously*"); + } +} + +// ANCHOR: here fn main() { - println!("A baby dog is called a {}", Dog::baby_name()); + let person = Human; + Pilot::fly(&person); + Wizard::fly(&person); + person.fly(); } +// ANCHOR_END: here diff --git a/listings/ch20-advanced-features/listing-20-20/Cargo.toml b/listings/ch20-advanced-features/listing-20-20/Cargo.toml index 52395a5..9c48a44 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-20/output.txt b/listings/ch20-advanced-features/listing-20-20/output.txt index 0e78ae2..b6e283f 100644 --- a/listings/ch20-advanced-features/listing-20-20/output.txt +++ b/listings/ch20-advanced-features/listing-20-20/output.txt @@ -1,18 +1,5 @@ $ cargo run Compiling traits-example v0.1.0 (file:///projects/traits-example) -error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type - --> src/main.rs:20:43 - | -2 | fn baby_name() -> String; - | ------------------------- `Animal::baby_name` defined here -... -20 | println!("A baby dog is called a {}", Animal::baby_name()); - | ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait - | -help: use the fully-qualified path to the only available implementation - | -20 | println!("A baby dog is called a {}", ::baby_name()); - | +++++++ + - -For more information about this error, try `rustc --explain E0790`. -error: could not compile `traits-example` (bin "traits-example") due to 1 previous error + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.54s + Running `target/debug/traits-example` +A baby dog is called a Spot diff --git a/listings/ch20-advanced-features/listing-20-20/src/main.rs b/listings/ch20-advanced-features/listing-20-20/src/main.rs index 8e295c9..44affe0 100644 --- a/listings/ch20-advanced-features/listing-20-20/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-20/src/main.rs @@ -16,8 +16,6 @@ impl Animal for Dog { } } -// ANCHOR: here fn main() { - println!("A baby dog is called a {}", Animal::baby_name()); + println!("A baby dog is called a {}", Dog::baby_name()); } -// ANCHOR_END: here diff --git a/listings/ch20-advanced-features/listing-20-21/Cargo.toml b/listings/ch20-advanced-features/listing-20-21/Cargo.toml index 52395a5..9c48a44 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-21/output.txt b/listings/ch20-advanced-features/listing-20-21/output.txt index f59d0bc..0e78ae2 100644 --- a/listings/ch20-advanced-features/listing-20-21/output.txt +++ b/listings/ch20-advanced-features/listing-20-21/output.txt @@ -1,5 +1,18 @@ $ cargo run Compiling traits-example v0.1.0 (file:///projects/traits-example) - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s - Running `target/debug/traits-example` -A baby dog is called a puppy +error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type + --> src/main.rs:20:43 + | +2 | fn baby_name() -> String; + | ------------------------- `Animal::baby_name` defined here +... +20 | println!("A baby dog is called a {}", Animal::baby_name()); + | ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait + | +help: use the fully-qualified path to the only available implementation + | +20 | println!("A baby dog is called a {}", ::baby_name()); + | +++++++ + + +For more information about this error, try `rustc --explain E0790`. +error: could not compile `traits-example` (bin "traits-example") due to 1 previous error diff --git a/listings/ch20-advanced-features/listing-20-21/src/main.rs b/listings/ch20-advanced-features/listing-20-21/src/main.rs index b1df728..8e295c9 100644 --- a/listings/ch20-advanced-features/listing-20-21/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-21/src/main.rs @@ -18,6 +18,6 @@ impl Animal for Dog { // ANCHOR: here fn main() { - println!("A baby dog is called a {}", ::baby_name()); + println!("A baby dog is called a {}", Animal::baby_name()); } // ANCHOR_END: here diff --git a/listings/ch20-advanced-features/listing-20-22/Cargo.toml b/listings/ch20-advanced-features/listing-20-22/Cargo.toml index 52395a5..9c48a44 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-18/output.txt b/listings/ch20-advanced-features/listing-20-22/output.txt similarity index 73% rename from listings/ch20-advanced-features/listing-20-18/output.txt rename to listings/ch20-advanced-features/listing-20-22/output.txt index d7e315b..f59d0bc 100644 --- a/listings/ch20-advanced-features/listing-20-18/output.txt +++ b/listings/ch20-advanced-features/listing-20-22/output.txt @@ -1,7 +1,5 @@ $ cargo run Compiling traits-example v0.1.0 (file:///projects/traits-example) - Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.46s + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.48s Running `target/debug/traits-example` -This is your captain speaking. -Up! -*waving arms furiously* +A baby dog is called a puppy diff --git a/listings/ch20-advanced-features/listing-20-22/src/main.rs b/listings/ch20-advanced-features/listing-20-22/src/main.rs index 7069fef..b1df728 100644 --- a/listings/ch20-advanced-features/listing-20-22/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-22/src/main.rs @@ -1,17 +1,23 @@ -// ANCHOR: here -use std::fmt; +trait Animal { + fn baby_name() -> String; +} -trait OutlinePrint: fmt::Display { - fn outline_print(&self) { - let output = self.to_string(); - let len = output.len(); - println!("{}", "*".repeat(len + 4)); - println!("*{}*", " ".repeat(len + 2)); - println!("* {output} *"); - println!("*{}*", " ".repeat(len + 2)); - println!("{}", "*".repeat(len + 4)); +struct Dog; + +impl Dog { + fn baby_name() -> String { + String::from("Spot") } } -// ANCHOR_END: here -fn main() {} +impl Animal for Dog { + fn baby_name() -> String { + String::from("puppy") + } +} + +// ANCHOR: here +fn main() { + println!("A baby dog is called a {}", ::baby_name()); +} +// ANCHOR_END: here diff --git a/listings/ch20-advanced-features/listing-20-23/Cargo.toml b/listings/ch20-advanced-features/listing-20-23/Cargo.toml index 52395a5..9c48a44 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-23/src/main.rs b/listings/ch20-advanced-features/listing-20-23/src/main.rs index f8c8366..7069fef 100644 --- a/listings/ch20-advanced-features/listing-20-23/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-23/src/main.rs @@ -1,14 +1,17 @@ +// ANCHOR: here use std::fmt; -struct Wrapper(Vec); - -impl fmt::Display for Wrapper { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "[{}]", self.0.join(", ")) +trait OutlinePrint: fmt::Display { + fn outline_print(&self) { + let output = self.to_string(); + let len = output.len(); + println!("{}", "*".repeat(len + 4)); + println!("*{}*", " ".repeat(len + 2)); + println!("* {output} *"); + println!("*{}*", " ".repeat(len + 2)); + println!("{}", "*".repeat(len + 4)); } } +// ANCHOR_END: here -fn main() { - let w = Wrapper(vec![String::from("hello"), String::from("world")]); - println!("w = {w}"); -} +fn main() {} diff --git a/listings/ch20-advanced-features/listing-20-24/Cargo.lock b/listings/ch20-advanced-features/listing-20-24/Cargo.lock index c0c98a7..b1977d0 100644 --- a/listings/ch20-advanced-features/listing-20-24/Cargo.lock +++ b/listings/ch20-advanced-features/listing-20-24/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "types-example" +name = "traits-example" version = "0.1.0" diff --git a/listings/ch20-advanced-features/listing-20-24/Cargo.toml b/listings/ch20-advanced-features/listing-20-24/Cargo.toml index a2ae20c..9c48a44 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 = "types-example" +name = "traits-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-24/src/main.rs b/listings/ch20-advanced-features/listing-20-24/src/main.rs index d604ae8..f8c8366 100644 --- a/listings/ch20-advanced-features/listing-20-24/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-24/src/main.rs @@ -1,16 +1,14 @@ -fn main() { - // ANCHOR: here - let f: Box = Box::new(|| println!("hi")); +use std::fmt; - fn takes_long_type(f: Box) { - // --snip-- - } +struct Wrapper(Vec); - fn returns_long_type() -> Box { - // --snip-- - // ANCHOR_END: here - Box::new(|| ()) - // ANCHOR: here +impl fmt::Display for Wrapper { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "[{}]", self.0.join(", ")) } - // ANCHOR_END: here +} + +fn main() { + let w = Wrapper(vec![String::from("hello"), String::from("world")]); + println!("w = {w}"); } diff --git a/listings/ch20-advanced-features/listing-20-25/Cargo.toml b/listings/ch20-advanced-features/listing-20-25/Cargo.toml index a2ae20c..9884d38 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-25/src/main.rs b/listings/ch20-advanced-features/listing-20-25/src/main.rs index af35bed..d604ae8 100644 --- a/listings/ch20-advanced-features/listing-20-25/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-25/src/main.rs @@ -1,14 +1,12 @@ fn main() { // ANCHOR: here - type Thunk = Box; + let f: Box = Box::new(|| println!("hi")); - let f: Thunk = Box::new(|| println!("hi")); - - fn takes_long_type(f: Thunk) { + fn takes_long_type(f: Box) { // --snip-- } - fn returns_long_type() -> Thunk { + fn returns_long_type() -> Box { // --snip-- // ANCHOR_END: here Box::new(|| ()) diff --git a/listings/ch20-advanced-features/listing-20-26/Cargo.lock b/listings/ch20-advanced-features/listing-20-26/Cargo.lock new file mode 100644 index 0000000..c0c98a7 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-26/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "types-example" +version = "0.1.0" + diff --git a/listings/ch20-advanced-features/listing-20-26/Cargo.toml b/listings/ch20-advanced-features/listing-20-26/Cargo.toml new file mode 100644 index 0000000..9884d38 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-26/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "types-example" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/listings/ch20-advanced-features/listing-20-26/src/main.rs b/listings/ch20-advanced-features/listing-20-26/src/main.rs new file mode 100644 index 0000000..af35bed --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-26/src/main.rs @@ -0,0 +1,18 @@ +fn main() { + // ANCHOR: here + type Thunk = Box; + + let f: Thunk = Box::new(|| println!("hi")); + + fn takes_long_type(f: Thunk) { + // --snip-- + } + + fn returns_long_type() -> Thunk { + // --snip-- + // ANCHOR_END: here + Box::new(|| ()) + // ANCHOR: here + } + // ANCHOR_END: here +} diff --git a/listings/ch20-advanced-features/listing-20-28/Cargo.lock b/listings/ch20-advanced-features/listing-20-28/Cargo.lock index b2d9257..b2327c7 100644 --- a/listings/ch20-advanced-features/listing-20-28/Cargo.lock +++ b/listings/ch20-advanced-features/listing-20-28/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "macros-example" +name = "functions-example" version = "0.1.0" diff --git a/listings/ch20-advanced-features/listing-20-28/Cargo.toml b/listings/ch20-advanced-features/listing-20-28/Cargo.toml index 9218091..3644460 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 = "macros-example" +name = "functions-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-27/src/main.rs b/listings/ch20-advanced-features/listing-20-28/src/main.rs similarity index 100% rename from listings/ch20-advanced-features/listing-20-27/src/main.rs rename to listings/ch20-advanced-features/listing-20-28/src/main.rs diff --git a/listings/ch20-advanced-features/listing-20-27/Cargo.lock b/listings/ch20-advanced-features/listing-20-29/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/listing-20-27/Cargo.lock rename to listings/ch20-advanced-features/listing-20-29/Cargo.lock diff --git a/listings/ch20-advanced-features/listing-20-27/Cargo.toml b/listings/ch20-advanced-features/listing-20-29/Cargo.toml similarity index 80% rename from listings/ch20-advanced-features/listing-20-27/Cargo.toml rename to listings/ch20-advanced-features/listing-20-29/Cargo.toml index b196f35..3644460 100644 --- a/listings/ch20-advanced-features/listing-20-27/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-29/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-15-map-closure/src/main.rs b/listings/ch20-advanced-features/listing-20-29/src/main.rs similarity index 100% rename from listings/ch20-advanced-features/no-listing-15-map-closure/src/main.rs rename to listings/ch20-advanced-features/listing-20-29/src/main.rs diff --git a/listings/ch20-advanced-features/listing-20-30/Cargo.lock b/listings/ch20-advanced-features/listing-20-30/Cargo.lock index 39afcf2..b2327c7 100644 --- a/listings/ch20-advanced-features/listing-20-30/Cargo.lock +++ b/listings/ch20-advanced-features/listing-20-30/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "hello_macro" +name = "functions-example" version = "0.1.0" diff --git a/listings/ch20-advanced-features/listing-20-30/Cargo.toml b/listings/ch20-advanced-features/listing-20-30/Cargo.toml index c6fb920..3644460 100644 --- a/listings/ch20-advanced-features/listing-20-30/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-30/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "hello_macro" +name = "functions-example" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/listings/ch20-advanced-features/listing-20-30/src/main.rs b/listings/ch20-advanced-features/listing-20-30/src/main.rs index 468c30a..dff20fe 100644 --- a/listings/ch20-advanced-features/listing-20-30/src/main.rs +++ b/listings/ch20-advanced-features/listing-20-30/src/main.rs @@ -1,9 +1,7 @@ -use hello_macro::HelloMacro; -use hello_macro_derive::HelloMacro; - -#[derive(HelloMacro)] -struct Pancakes; - fn main() { - Pancakes::hello_macro(); + // ANCHOR: here + let list_of_numbers = vec![1, 2, 3]; + let list_of_strings: Vec = + list_of_numbers.iter().map(ToString::to_string).collect(); + // ANCHOR_END: here } diff --git a/listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.lock b/listings/ch20-advanced-features/listing-20-31/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.lock rename to listings/ch20-advanced-features/listing-20-31/Cargo.lock diff --git a/listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.toml b/listings/ch20-advanced-features/listing-20-31/Cargo.toml similarity index 80% rename from listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.toml rename to listings/ch20-advanced-features/listing-20-31/Cargo.toml index b196f35..3644460 100644 --- a/listings/ch20-advanced-features/no-listing-15-map-closure/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-31/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/src/main.rs b/listings/ch20-advanced-features/listing-20-31/src/main.rs similarity index 100% rename from listings/ch20-advanced-features/no-listing-17-map-initializer/src/main.rs rename to listings/ch20-advanced-features/listing-20-31/src/main.rs diff --git a/listings/ch20-advanced-features/no-listing-16-map-function/Cargo.lock b/listings/ch20-advanced-features/listing-20-32/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/no-listing-16-map-function/Cargo.lock rename to listings/ch20-advanced-features/listing-20-32/Cargo.lock diff --git a/listings/ch20-advanced-features/no-listing-16-map-function/Cargo.toml b/listings/ch20-advanced-features/listing-20-32/Cargo.toml similarity index 80% rename from listings/ch20-advanced-features/no-listing-16-map-function/Cargo.toml rename to listings/ch20-advanced-features/listing-20-32/Cargo.toml index b196f35..3644460 100644 --- a/listings/ch20-advanced-features/no-listing-16-map-function/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-32/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-32/src/lib.rs b/listings/ch20-advanced-features/listing-20-32/src/lib.rs new file mode 100644 index 0000000..7679cc7 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-32/src/lib.rs @@ -0,0 +1,3 @@ +fn returns_closure() -> impl Fn(i32) -> i32 { + |x| x + 1 +} diff --git a/listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.lock b/listings/ch20-advanced-features/listing-20-33/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.lock rename to listings/ch20-advanced-features/listing-20-33/Cargo.lock diff --git a/listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.toml b/listings/ch20-advanced-features/listing-20-33/Cargo.toml similarity index 80% rename from listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.toml rename to listings/ch20-advanced-features/listing-20-33/Cargo.toml index b196f35..3644460 100644 --- a/listings/ch20-advanced-features/no-listing-17-map-initializer/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-33/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-33/output.txt b/listings/ch20-advanced-features/listing-20-33/output.txt new file mode 100644 index 0000000..2825c07 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-33/output.txt @@ -0,0 +1,20 @@ +$ cargo build + Compiling functions-example v0.1.0 (file:///projects/functions-example) +error[E0308]: mismatched types + --> src/main.rs:2:44 + | +2 | let handlers = vec![returns_closure(), returns_initialized_closure(123)]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected opaque type, found a different opaque type +... +9 | fn returns_closure() -> impl Fn(i32) -> i32 { + | ------------------- the expected opaque type +... +13 | fn returns_initialized_closure(init: i32) -> impl Fn(i32) -> i32 { + | ------------------- the found opaque type + | + = note: expected opaque type `impl Fn(i32) -> i32` (opaque type at ) + found opaque type `impl Fn(i32) -> i32` (opaque type at ) + = note: distinct uses of `impl Trait` result in different opaque types + +For more information about this error, try `rustc --explain E0308`. +error: could not compile `functions-example` (bin "functions-example") due to 1 previous error diff --git a/listings/ch20-advanced-features/listing-20-33/src/main.rs b/listings/ch20-advanced-features/listing-20-33/src/main.rs new file mode 100644 index 0000000..d7db7a0 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-33/src/main.rs @@ -0,0 +1,15 @@ +fn main() { + let handlers = vec![returns_closure(), returns_initialized_closure(123)]; + for handler in handlers { + let output = handler(5); + println!("{output}"); + } +} + +fn returns_closure() -> impl Fn(i32) -> i32 { + |x| x + 1 +} + +fn returns_initialized_closure(init: i32) -> impl Fn(i32) -> i32 { + move |x| x + init +} diff --git a/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.lock b/listings/ch20-advanced-features/listing-20-34/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.lock rename to listings/ch20-advanced-features/listing-20-34/Cargo.lock diff --git a/listings/ch20-advanced-features/listing-20-34/Cargo.toml b/listings/ch20-advanced-features/listing-20-34/Cargo.toml new file mode 100644 index 0000000..3644460 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-34/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "functions-example" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/listings/ch20-advanced-features/listing-20-34/src/main.rs b/listings/ch20-advanced-features/listing-20-34/src/main.rs new file mode 100644 index 0000000..975a7f5 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-34/src/main.rs @@ -0,0 +1,17 @@ +fn main() { + let handlers = vec![returns_closure(), returns_initialized_closure(123)]; + for handler in handlers { + let output = handler(5); + println!("{output}"); + } +} + +// ANCHOR: here +fn returns_closure() -> Box i32> { + Box::new(|x| x + 1) +} + +fn returns_initialized_closure(init: i32) -> Box i32> { + Box::new(move |x| x + init) +} +// ANCHOR_END: here diff --git a/listings/ch20-advanced-features/listing-20-35/Cargo.lock b/listings/ch20-advanced-features/listing-20-35/Cargo.lock new file mode 100644 index 0000000..b2d9257 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-35/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "macros-example" +version = "0.1.0" + diff --git a/listings/ch20-advanced-features/listing-20-35/Cargo.toml b/listings/ch20-advanced-features/listing-20-35/Cargo.toml new file mode 100644 index 0000000..76689ec --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-35/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "macros-example" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/listings/ch20-advanced-features/listing-20-28/src/lib.rs b/listings/ch20-advanced-features/listing-20-35/src/lib.rs similarity index 100% rename from listings/ch20-advanced-features/listing-20-28/src/lib.rs rename to listings/ch20-advanced-features/listing-20-35/src/lib.rs diff --git a/listings/ch20-advanced-features/listing-20-31/hello_macro/Cargo.lock b/listings/ch20-advanced-features/listing-20-37/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/listing-20-31/hello_macro/Cargo.lock rename to listings/ch20-advanced-features/listing-20-37/Cargo.lock diff --git a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml b/listings/ch20-advanced-features/listing-20-37/Cargo.toml similarity index 79% rename from listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml rename to listings/ch20-advanced-features/listing-20-37/Cargo.toml index c6fb920..aaaf3bf 100644 --- a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-37/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-37/src/main.rs b/listings/ch20-advanced-features/listing-20-37/src/main.rs new file mode 100644 index 0000000..468c30a --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-37/src/main.rs @@ -0,0 +1,9 @@ +use hello_macro::HelloMacro; +use hello_macro_derive::HelloMacro; + +#[derive(HelloMacro)] +struct Pancakes; + +fn main() { + Pancakes::hello_macro(); +} diff --git a/listings/ch20-advanced-features/listing-20-33/hello_macro/Cargo.lock b/listings/ch20-advanced-features/listing-20-38/hello_macro/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/listing-20-33/hello_macro/Cargo.lock rename to listings/ch20-advanced-features/listing-20-38/hello_macro/Cargo.lock diff --git a/listings/ch20-advanced-features/listing-20-31/hello_macro/Cargo.toml b/listings/ch20-advanced-features/listing-20-38/hello_macro/Cargo.toml similarity index 79% rename from listings/ch20-advanced-features/listing-20-31/hello_macro/Cargo.toml rename to listings/ch20-advanced-features/listing-20-38/hello_macro/Cargo.toml index c6fb920..aaaf3bf 100644 --- a/listings/ch20-advanced-features/listing-20-31/hello_macro/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-38/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-31/hello_macro/src/lib.rs b/listings/ch20-advanced-features/listing-20-38/hello_macro/src/lib.rs similarity index 100% rename from listings/ch20-advanced-features/listing-20-31/hello_macro/src/lib.rs rename to listings/ch20-advanced-features/listing-20-38/hello_macro/src/lib.rs diff --git a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.lock b/listings/ch20-advanced-features/listing-20-39/hello_macro/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/Cargo.lock rename to listings/ch20-advanced-features/listing-20-39/hello_macro/Cargo.lock diff --git a/listings/ch20-advanced-features/listing-20-33/hello_macro/Cargo.toml b/listings/ch20-advanced-features/listing-20-39/hello_macro/Cargo.toml similarity index 79% rename from listings/ch20-advanced-features/listing-20-33/hello_macro/Cargo.toml rename to listings/ch20-advanced-features/listing-20-39/hello_macro/Cargo.toml index c6fb920..aaaf3bf 100644 --- a/listings/ch20-advanced-features/listing-20-33/hello_macro/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-39/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-33/hello_macro/src/lib.rs b/listings/ch20-advanced-features/listing-20-39/hello_macro/src/lib.rs similarity index 100% rename from listings/ch20-advanced-features/listing-20-33/hello_macro/src/lib.rs rename to listings/ch20-advanced-features/listing-20-39/hello_macro/src/lib.rs diff --git a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.lock b/listings/ch20-advanced-features/listing-20-39/pancakes/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.lock rename to listings/ch20-advanced-features/listing-20-39/pancakes/Cargo.lock diff --git a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml b/listings/ch20-advanced-features/listing-20-39/pancakes/Cargo.toml similarity index 85% rename from listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml rename to listings/ch20-advanced-features/listing-20-39/pancakes/Cargo.toml index 3ad9108..faee67f 100644 --- a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-39/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/listing-20-31/hello_macro/src/main.rs b/listings/ch20-advanced-features/listing-20-39/pancakes/src/main.rs similarity index 100% rename from listings/ch20-advanced-features/listing-20-31/hello_macro/src/main.rs rename to listings/ch20-advanced-features/listing-20-39/pancakes/src/main.rs diff --git a/listings/ch20-advanced-features/listing-20-40/hello_macro/Cargo.lock b/listings/ch20-advanced-features/listing-20-40/hello_macro/Cargo.lock new file mode 100644 index 0000000..39afcf2 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-40/hello_macro/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_macro" +version = "0.1.0" + diff --git a/listings/ch20-advanced-features/listing-20-40/hello_macro/Cargo.toml b/listings/ch20-advanced-features/listing-20-40/hello_macro/Cargo.toml new file mode 100644 index 0000000..aaaf3bf --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-40/hello_macro/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello_macro" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/listings/ch20-advanced-features/listing-20-31/hello_macro/hello_macro_derive/Cargo.lock b/listings/ch20-advanced-features/listing-20-40/hello_macro/hello_macro_derive/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/listing-20-31/hello_macro/hello_macro_derive/Cargo.lock rename to listings/ch20-advanced-features/listing-20-40/hello_macro/hello_macro_derive/Cargo.lock diff --git a/listings/ch20-advanced-features/listing-20-33/hello_macro/hello_macro_derive/Cargo.toml b/listings/ch20-advanced-features/listing-20-40/hello_macro/hello_macro_derive/Cargo.toml similarity index 87% rename from listings/ch20-advanced-features/listing-20-33/hello_macro/hello_macro_derive/Cargo.toml rename to listings/ch20-advanced-features/listing-20-40/hello_macro/hello_macro_derive/Cargo.toml index ed9e917..8e54d81 100644 --- a/listings/ch20-advanced-features/listing-20-33/hello_macro/hello_macro_derive/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-40/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-31/hello_macro/hello_macro_derive/src/lib.rs b/listings/ch20-advanced-features/listing-20-40/hello_macro/hello_macro_derive/src/lib.rs similarity index 80% rename from listings/ch20-advanced-features/listing-20-31/hello_macro/hello_macro_derive/src/lib.rs rename to listings/ch20-advanced-features/listing-20-40/hello_macro/hello_macro_derive/src/lib.rs index 839ec83..7ae9e55 100644 --- a/listings/ch20-advanced-features/listing-20-31/hello_macro/hello_macro_derive/src/lib.rs +++ b/listings/ch20-advanced-features/listing-20-40/hello_macro/hello_macro_derive/src/lib.rs @@ -4,9 +4,9 @@ use quote::quote; #[proc_macro_derive(HelloMacro)] pub fn hello_macro_derive(input: TokenStream) -> TokenStream { // Construct a representation of Rust code as a syntax tree - // that we can manipulate + // that we can manipulate. let ast = syn::parse(input).unwrap(); - // Build the trait implementation + // Build the trait implementation. impl_hello_macro(&ast) } diff --git a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/src/lib.rs b/listings/ch20-advanced-features/listing-20-40/hello_macro/src/lib.rs similarity index 100% rename from listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/hello_macro/src/lib.rs rename to listings/ch20-advanced-features/listing-20-40/hello_macro/src/lib.rs diff --git a/listings/ch20-advanced-features/listing-20-33/hello_macro/src/main.rs b/listings/ch20-advanced-features/listing-20-40/hello_macro/src/main.rs similarity index 100% rename from listings/ch20-advanced-features/listing-20-33/hello_macro/src/main.rs rename to listings/ch20-advanced-features/listing-20-40/hello_macro/src/main.rs diff --git a/listings/ch20-advanced-features/listing-20-42/hello_macro/Cargo.lock b/listings/ch20-advanced-features/listing-20-42/hello_macro/Cargo.lock new file mode 100644 index 0000000..39afcf2 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-42/hello_macro/Cargo.lock @@ -0,0 +1,6 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "hello_macro" +version = "0.1.0" + diff --git a/listings/ch20-advanced-features/listing-20-42/hello_macro/Cargo.toml b/listings/ch20-advanced-features/listing-20-42/hello_macro/Cargo.toml new file mode 100644 index 0000000..aaaf3bf --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-42/hello_macro/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "hello_macro" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/listings/ch20-advanced-features/listing-20-33/hello_macro/hello_macro_derive/Cargo.lock b/listings/ch20-advanced-features/listing-20-42/hello_macro/hello_macro_derive/Cargo.lock similarity index 100% rename from listings/ch20-advanced-features/listing-20-33/hello_macro/hello_macro_derive/Cargo.lock rename to listings/ch20-advanced-features/listing-20-42/hello_macro/hello_macro_derive/Cargo.lock diff --git a/listings/ch20-advanced-features/listing-20-31/hello_macro/hello_macro_derive/Cargo.toml b/listings/ch20-advanced-features/listing-20-42/hello_macro/hello_macro_derive/Cargo.toml similarity index 87% rename from listings/ch20-advanced-features/listing-20-31/hello_macro/hello_macro_derive/Cargo.toml rename to listings/ch20-advanced-features/listing-20-42/hello_macro/hello_macro_derive/Cargo.toml index ed9e917..8e54d81 100644 --- a/listings/ch20-advanced-features/listing-20-31/hello_macro/hello_macro_derive/Cargo.toml +++ b/listings/ch20-advanced-features/listing-20-42/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-33/hello_macro/hello_macro_derive/src/lib.rs b/listings/ch20-advanced-features/listing-20-42/hello_macro/hello_macro_derive/src/lib.rs similarity index 92% rename from listings/ch20-advanced-features/listing-20-33/hello_macro/hello_macro_derive/src/lib.rs rename to listings/ch20-advanced-features/listing-20-42/hello_macro/hello_macro_derive/src/lib.rs index ba1215f..bba8ffb 100644 --- a/listings/ch20-advanced-features/listing-20-33/hello_macro/hello_macro_derive/src/lib.rs +++ b/listings/ch20-advanced-features/listing-20-42/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/listing-20-42/hello_macro/src/lib.rs b/listings/ch20-advanced-features/listing-20-42/hello_macro/src/lib.rs new file mode 100644 index 0000000..e747931 --- /dev/null +++ b/listings/ch20-advanced-features/listing-20-42/hello_macro/src/lib.rs @@ -0,0 +1,3 @@ +pub trait HelloMacro { + fn hello_macro(); +} diff --git a/listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/src/main.rs b/listings/ch20-advanced-features/listing-20-42/hello_macro/src/main.rs similarity index 100% rename from listings/ch20-advanced-features/no-listing-20-impl-hellomacro-for-pancakes/pancakes/src/main.rs rename to listings/ch20-advanced-features/listing-20-42/hello_macro/src/main.rs 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 3e8a292..690cfbd 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 52395a5..9c48a44 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 52395a5..9c48a44 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 a2ae20c..9884d38 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 52395a5..9c48a44 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 52395a5..9c48a44 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 52395a5..9c48a44 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 a2ae20c..9884d38 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 a2ae20c..9884d38 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 a2ae20c..9884d38 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 a2ae20c..9884d38 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 a2ae20c..9884d38 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 a2ae20c..9884d38 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 a2ae20c..9884d38 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-16-map-function/src/main.rs b/listings/ch20-advanced-features/no-listing-16-map-function/src/main.rs deleted file mode 100644 index dff20fe..0000000 --- a/listings/ch20-advanced-features/no-listing-16-map-function/src/main.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn main() { - // ANCHOR: here - let list_of_numbers = vec![1, 2, 3]; - let list_of_strings: Vec = - list_of_numbers.iter().map(ToString::to_string).collect(); - // ANCHOR_END: here -} 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 b196f35..3644460 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-18-returns-closure/output.txt b/listings/ch20-advanced-features/no-listing-18-returns-closure/output.txt deleted file mode 100644 index 3a23426..0000000 --- a/listings/ch20-advanced-features/no-listing-18-returns-closure/output.txt +++ /dev/null @@ -1,20 +0,0 @@ -$ cargo build - Compiling functions-example v0.1.0 (file:///projects/functions-example) -error[E0746]: return type cannot have an unboxed trait object - --> src/lib.rs:1:25 - | -1 | fn returns_closure() -> dyn Fn(i32) -> i32 { - | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | -help: consider returning an `impl Trait` instead of a `dyn Trait` - | -1 | fn returns_closure() -> impl Fn(i32) -> i32 { - | ~~~~ -help: alternatively, box the return type, and wrap all of the returned values in `Box::new` - | -1 ~ fn returns_closure() -> Box i32> { -2 ~ Box::new(|x| x + 1) - | - -For more information about this error, try `rustc --explain E0746`. -error: could not compile `functions-example` (lib) due to 1 previous error diff --git a/listings/ch20-advanced-features/no-listing-18-returns-closure/src/lib.rs b/listings/ch20-advanced-features/no-listing-18-returns-closure/src/lib.rs index d699ac3..20fb4bc 100644 --- a/listings/ch20-advanced-features/no-listing-18-returns-closure/src/lib.rs +++ b/listings/ch20-advanced-features/no-listing-18-returns-closure/src/lib.rs @@ -1,3 +1,3 @@ -fn returns_closure() -> dyn Fn(i32) -> i32 { - |x| x + 1 +fn returns_closure(init: i32) -> impl Fn(i32) -> i32 { + move |x| x + init } 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 deleted file mode 100644 index b196f35..0000000 --- a/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "functions-example" -version = "0.1.0" -edition = "2021" - -[dependencies] diff --git a/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/src/lib.rs b/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/src/lib.rs deleted file mode 100644 index b114077..0000000 --- a/listings/ch20-advanced-features/no-listing-19-returns-closure-trait-object/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn returns_closure() -> Box i32> { - Box::new(|x| x + 1) -} 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 c6fb920..aaaf3bf 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 ed9e917..8e54d81 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 cb3a98c..2b1b36c 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 9e103f3..2096415 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 3e8a292..690cfbd 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 b14994c..f85a4d3 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 fe61947..f6f3649 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 fe61947..f6f3649 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 1eff2ee..fe31142 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 fe61947..f6f3649 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 17c8401..52e586a 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 fe61947..f6f3649 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 437d9b6..25fc312 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 fe61947..f6f3649 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 843d846..2b26aef 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 fe61947..f6f3649 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 e19467b..137ecd9 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 fe61947..f6f3649 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 0f9356a..001491d 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 fe61947..f6f3649 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 0679ec6..81b3656 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 fe61947..f6f3649 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 075a0d9..dd3c52b 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 fe61947..f6f3649 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 bde3e29..fb0678f 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 fe61947..f6f3649 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 4bff8ac..7df8ed3 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 aeb1fac..c240bec 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 86157c9..17540e7 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 17b37e7..be899fe 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 554bfd8..0634b66 100644 --- a/listings/ch21-web-server/listing-21-22/output.txt +++ b/listings/ch21-web-server/listing-21-22/output.txt @@ -9,7 +9,7 @@ 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` - --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:1778:17 + --> /rustc/4eb161250e340c8f48f66e2b929ef4a5bed7c181/library/std/src/thread/mod.rs:1876:17 For more information about this error, try `rustc --explain E0507`. error: could not compile `hello` (lib) due to 1 previous error 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 72a8c48..7c7eb6e 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 eea339b..a767864 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, }; @@ -61,12 +61,10 @@ impl Drop for ThreadPool { fn drop(&mut self) { drop(self.sender.take()); - for worker in &mut self.workers { + for worker in self.workers.drain(..) { println!("Shutting down worker {}", worker.id); - if let Some(thread) = worker.thread.take() { - thread.join().unwrap(); - } + worker.thread.join().unwrap(); } } } @@ -74,22 +72,21 @@ impl Drop for ThreadPool { struct Worker { id: usize, - thread: Option>, + thread: thread::JoinHandle<()>, } 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: Some(thread), - } + 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 acd703f..f68c11e 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 fe61947..f6f3649 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 28c0dea..cef880d 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, }; @@ -51,44 +51,41 @@ impl Drop for ThreadPool { fn drop(&mut self) { drop(self.sender.take()); - for worker in &mut self.workers { + for worker in self.workers.drain(..) { println!("Shutting down worker {}", worker.id); - if let Some(thread) = worker.thread.take() { - thread.join().unwrap(); - } + worker.thread.join().unwrap(); } } } struct Worker { id: usize, - thread: Option>, + thread: thread::JoinHandle<()>, } // ANCHOR: here impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let message = receiver.lock().unwrap().recv(); + let thread = thread::spawn(move || { + loop { + let message = receiver.lock().unwrap().recv(); - match message { - Ok(job) => { - println!("Worker {id} got a job; executing."); + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); - job(); - } - Err(_) => { - println!("Worker {id} disconnected; shutting down."); - break; + job(); + } + Err(_) => { + println!("Worker {id} disconnected; shutting down."); + break; + } } } }); - Worker { - id, - thread: Some(thread), - } + Worker { id, thread } } } // ANCHOR_END: here 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 acd703f..f68c11e 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 fe61947..f6f3649 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 54c0489..8db88f2 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, }; @@ -51,42 +51,39 @@ impl Drop for ThreadPool { fn drop(&mut self) { drop(self.sender.take()); - for worker in &mut self.workers { + for worker in self.workers.drain(..) { println!("Shutting down worker {}", worker.id); - if let Some(thread) = worker.thread.take() { - thread.join().unwrap(); - } + worker.thread.join().unwrap(); } } } struct Worker { id: usize, - thread: Option>, + thread: thread::JoinHandle<()>, } impl Worker { fn new(id: usize, receiver: Arc>>) -> Worker { - let thread = thread::spawn(move || loop { - let message = receiver.lock().unwrap().recv(); + let thread = thread::spawn(move || { + loop { + let message = receiver.lock().unwrap().recv(); - match message { - Ok(job) => { - println!("Worker {id} got a job; executing."); + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); - job(); - } - Err(_) => { - println!("Worker {id} disconnected; shutting down."); - break; + job(); + } + Err(_) => { + println!("Worker {id} disconnected; shutting down."); + break; + } } } }); - Worker { - id, - thread: Some(thread), - } + Worker { id, thread } } } 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 ee0f1ef..dabf2e4 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 fe61947..f6f3649 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 e68f72c..e3c522c 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 fe61947..f6f3649 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 1f075fd..ca3608d 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-worker-definition/404.html b/listings/ch21-web-server/no-listing-04-update-drop-definition/404.html similarity index 100% rename from listings/ch21-web-server/no-listing-04-update-worker-definition/404.html rename to listings/ch21-web-server/no-listing-04-update-drop-definition/404.html diff --git a/listings/ch21-web-server/no-listing-04-update-worker-definition/Cargo.lock b/listings/ch21-web-server/no-listing-04-update-drop-definition/Cargo.lock similarity index 100% rename from listings/ch21-web-server/no-listing-04-update-worker-definition/Cargo.lock rename to listings/ch21-web-server/no-listing-04-update-drop-definition/Cargo.lock diff --git a/listings/ch21-web-server/no-listing-04-update-worker-definition/Cargo.toml b/listings/ch21-web-server/no-listing-04-update-drop-definition/Cargo.toml similarity index 77% rename from listings/ch21-web-server/no-listing-04-update-worker-definition/Cargo.toml rename to listings/ch21-web-server/no-listing-04-update-drop-definition/Cargo.toml index fe61947..f6f3649 100644 --- a/listings/ch21-web-server/no-listing-04-update-worker-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-worker-definition/hello.html b/listings/ch21-web-server/no-listing-04-update-drop-definition/hello.html similarity index 100% rename from listings/ch21-web-server/no-listing-04-update-worker-definition/hello.html rename to listings/ch21-web-server/no-listing-04-update-drop-definition/hello.html 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 new file mode 100644 index 0000000..a59b08b --- /dev/null +++ b/listings/ch21-web-server/no-listing-04-update-drop-definition/output.txt @@ -0,0 +1,3 @@ +$ cargo check + Checking hello v0.1.0 (file:///projects/hello) + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.07s diff --git a/listings/ch21-web-server/no-listing-04-update-worker-definition/src/lib.rs b/listings/ch21-web-server/no-listing-04-update-drop-definition/src/lib.rs similarity index 79% rename from listings/ch21-web-server/no-listing-04-update-worker-definition/src/lib.rs rename to listings/ch21-web-server/no-listing-04-update-drop-definition/src/lib.rs index 6ef710a..d9fda0f 100644 --- a/listings/ch21-web-server/no-listing-04-update-worker-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, }; @@ -44,31 +44,33 @@ impl ThreadPool { } } +// ANCHOR: here impl Drop for ThreadPool { fn drop(&mut self) { - for worker in &mut self.workers { + for worker in self.workers.drain(..) { println!("Shutting down worker {}", worker.id); worker.thread.join().unwrap(); } } } +// ANCHOR_END: here -// ANCHOR: here struct Worker { id: usize, - thread: Option>, + thread: thread::JoinHandle<()>, } -// ANCHOR_END: here 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-worker-definition/src/main.rs b/listings/ch21-web-server/no-listing-04-update-drop-definition/src/main.rs similarity index 97% rename from listings/ch21-web-server/no-listing-04-update-worker-definition/src/main.rs rename to listings/ch21-web-server/no-listing-04-update-drop-definition/src/main.rs index 1f075fd..ca3608d 100644 --- a/listings/ch21-web-server/no-listing-04-update-worker-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-04-update-worker-definition/output.txt b/listings/ch21-web-server/no-listing-04-update-worker-definition/output.txt deleted file mode 100644 index 6867dcb..0000000 --- a/listings/ch21-web-server/no-listing-04-update-worker-definition/output.txt +++ /dev/null @@ -1,31 +0,0 @@ -$ 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<()>` - --> /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:1778:5 -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 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 fe61947..f6f3649 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 ede3750..31237a6 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 1f075fd..ca3608d 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 fe61947..f6f3649 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 b795ea5..9fb67e0 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 acd703f..f68c11e 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 fe61947..f6f3649 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 54c0489..e8decb0 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(); + let thread = thread::spawn(move || { + loop { + let message = receiver.lock().unwrap().recv(); - match message { - Ok(job) => { - println!("Worker {id} got a job; executing."); + match message { + Ok(job) => { + println!("Worker {id} got a job; executing."); - job(); - } - Err(_) => { - println!("Worker {id} disconnected; shutting down."); - break; + 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 acd703f..f68c11e 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/src/SUMMARY.md b/src/SUMMARY.md index 670240c..071e870 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -7,137 +7,137 @@ ## 入门指南 - [入门指南](ch01-00-getting-started.md) - - [安装](ch01-01-installation.md) - - [Hello, World!](ch01-02-hello-world.md) - - [Hello, Cargo!](ch01-03-hello-cargo.md) + - [安装](ch01-01-installation.md) + - [Hello, World!](ch01-02-hello-world.md) + - [Hello, Cargo!](ch01-03-hello-cargo.md) - [写个猜数字游戏](ch02-00-guessing-game-tutorial.md) - [常见编程概念](ch03-00-common-programming-concepts.md) - - [变量与可变性](ch03-01-variables-and-mutability.md) - - [数据类型](ch03-02-data-types.md) - - [函数](ch03-03-how-functions-work.md) - - [注释](ch03-04-comments.md) - - [控制流](ch03-05-control-flow.md) + - [变量与可变性](ch03-01-variables-and-mutability.md) + - [数据类型](ch03-02-data-types.md) + - [函数](ch03-03-how-functions-work.md) + - [注释](ch03-04-comments.md) + - [控制流](ch03-05-control-flow.md) - [认识所有权](ch04-00-understanding-ownership.md) - - [什么是所有权?](ch04-01-what-is-ownership.md) - - [引用与借用](ch04-02-references-and-borrowing.md) - - [Slice 类型](ch04-03-slices.md) + - [什么是所有权?](ch04-01-what-is-ownership.md) + - [引用与借用](ch04-02-references-and-borrowing.md) + - [Slice 类型](ch04-03-slices.md) - [使用结构体组织相关联的数据](ch05-00-structs.md) - - [结构体的定义和实例化](ch05-01-defining-structs.md) - - [结构体示例程序](ch05-02-example-structs.md) - - [方法语法](ch05-03-method-syntax.md) + - [结构体的定义和实例化](ch05-01-defining-structs.md) + - [结构体示例程序](ch05-02-example-structs.md) + - [方法语法](ch05-03-method-syntax.md) - [枚举和模式匹配](ch06-00-enums.md) - - [枚举的定义](ch06-01-defining-an-enum.md) - - [`match` 控制流结构](ch06-02-match.md) - - [`if let` 简洁控制流](ch06-03-if-let.md) + - [枚举的定义](ch06-01-defining-an-enum.md) + - [`match` 控制流结构](ch06-02-match.md) + - [`if let` 简洁控制流](ch06-03-if-let.md) ## 基本 Rust 技能 - [使用包、Crate 和模块管理不断增长的项目](ch07-00-managing-growing-projects-with-packages-crates-and-modules.md) - - [包和 Crate](ch07-01-packages-and-crates.md) - - [定义模块来控制作用域与私有性](ch07-02-defining-modules-to-control-scope-and-privacy.md) - - [引用模块项目的路径](ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md) - - [使用 `use` 关键字将路径引入作用域](ch07-04-bringing-paths-into-scope-with-the-use-keyword.md) - - [将模块拆分成多个文件](ch07-05-separating-modules-into-different-files.md) + - [包和 Crate](ch07-01-packages-and-crates.md) + - [定义模块来控制作用域与私有性](ch07-02-defining-modules-to-control-scope-and-privacy.md) + - [引用模块项目的路径](ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md) + - [使用 `use` 关键字将路径引入作用域](ch07-04-bringing-paths-into-scope-with-the-use-keyword.md) + - [将模块拆分成多个文件](ch07-05-separating-modules-into-different-files.md) - [常见集合](ch08-00-common-collections.md) - - [使用 Vector 储存列表](ch08-01-vectors.md) - - [使用字符串储存 UTF-8 编码的文本](ch08-02-strings.md) - - [使用 Hash Map 储存键值对](ch08-03-hash-maps.md) + - [使用 Vector 储存列表](ch08-01-vectors.md) + - [使用字符串储存 UTF-8 编码的文本](ch08-02-strings.md) + - [使用 Hash Map 储存键值对](ch08-03-hash-maps.md) - [错误处理](ch09-00-error-handling.md) - - [用 `panic!` 处理不可恢复的错误](ch09-01-unrecoverable-errors-with-panic.md) - - [用 `Result` 处理可恢复的错误](ch09-02-recoverable-errors-with-result.md) - - [要不要 `panic!`](ch09-03-to-panic-or-not-to-panic.md) + - [用 `panic!` 处理不可恢复的错误](ch09-01-unrecoverable-errors-with-panic.md) + - [用 `Result` 处理可恢复的错误](ch09-02-recoverable-errors-with-result.md) + - [要不要 `panic!`](ch09-03-to-panic-or-not-to-panic.md) - [泛型、Trait 和生命周期](ch10-00-generics.md) - - [泛型数据类型](ch10-01-syntax.md) - - [Trait:定义共同行为](ch10-02-traits.md) - - [生命周期确保引用有效](ch10-03-lifetime-syntax.md) + - [泛型数据类型](ch10-01-syntax.md) + - [Trait:定义共同行为](ch10-02-traits.md) + - [生命周期确保引用有效](ch10-03-lifetime-syntax.md) - [编写自动化测试](ch11-00-testing.md) - - [如何编写测试](ch11-01-writing-tests.md) - - [控制测试如何运行](ch11-02-running-tests.md) - - [测试的组织结构](ch11-03-test-organization.md) + - [如何编写测试](ch11-01-writing-tests.md) + - [控制测试如何运行](ch11-02-running-tests.md) + - [测试的组织结构](ch11-03-test-organization.md) - [一个 I/O 项目:构建命令行程序](ch12-00-an-io-project.md) - - [接受命令行参数](ch12-01-accepting-command-line-arguments.md) - - [读取文件](ch12-02-reading-a-file.md) - - [重构以改进模块化与错误处理](ch12-03-improving-error-handling-and-modularity.md) - - [采用测试驱动开发完善库的功能](ch12-04-testing-the-librarys-functionality.md) - - [处理环境变量](ch12-05-working-with-environment-variables.md) - - [将错误信息输出到标准错误而不是标准输出](ch12-06-writing-to-stderr-instead-of-stdout.md) + - [接受命令行参数](ch12-01-accepting-command-line-arguments.md) + - [读取文件](ch12-02-reading-a-file.md) + - [重构以改进模块化与错误处理](ch12-03-improving-error-handling-and-modularity.md) + - [采用测试驱动开发完善库的功能](ch12-04-testing-the-librarys-functionality.md) + - [处理环境变量](ch12-05-working-with-environment-variables.md) + - [将错误信息输出到标准错误而不是标准输出](ch12-06-writing-to-stderr-instead-of-stdout.md) ## Rust 编程思想 - [Rust 中的函数式语言功能:迭代器与闭包](ch13-00-functional-features.md) - - [闭包:可以捕获其环境的匿名函数](ch13-01-closures.md) - - [使用迭代器处理元素序列](ch13-02-iterators.md) - - [改进之前的 I/O 项目](ch13-03-improving-our-io-project.md) - - [性能比较:循环对迭代器](ch13-04-performance.md) + - [闭包:可以捕获其环境的匿名函数](ch13-01-closures.md) + - [使用迭代器处理元素序列](ch13-02-iterators.md) + - [改进之前的 I/O 项目](ch13-03-improving-our-io-project.md) + - [性能比较:循环对迭代器](ch13-04-performance.md) - [更多关于 Cargo 和 Crates.io 的内容](ch14-00-more-about-cargo.md) - - [采用发布配置自定义构建](ch14-01-release-profiles.md) - - [将 crate 发布到 Crates.io](ch14-02-publishing-to-crates-io.md) - - [Cargo 工作空间](ch14-03-cargo-workspaces.md) - - [使用 `cargo install` 安装二进制文件](ch14-04-installing-binaries.md) - - [Cargo 自定义扩展命令](ch14-05-extending-cargo.md) + - [采用发布配置自定义构建](ch14-01-release-profiles.md) + - [将 crate 发布到 Crates.io](ch14-02-publishing-to-crates-io.md) + - [Cargo 工作空间](ch14-03-cargo-workspaces.md) + - [使用 `cargo install` 安装二进制文件](ch14-04-installing-binaries.md) + - [Cargo 自定义扩展命令](ch14-05-extending-cargo.md) - [智能指针](ch15-00-smart-pointers.md) - - [使用 `Box` 指向堆上数据](ch15-01-box.md) - - [使用 `Deref` Trait 将智能指针当作常规引用处理](ch15-02-deref.md) - - [使用 `Drop` Trait 运行清理代码](ch15-03-drop.md) - - [`Rc` 引用计数智能指针](ch15-04-rc.md) - - [`RefCell` 与内部可变性模式](ch15-05-interior-mutability.md) - - [引用循环会导致内存泄漏](ch15-06-reference-cycles.md) + - [使用 `Box` 指向堆上数据](ch15-01-box.md) + - [使用 `Deref` Trait 将智能指针当作常规引用处理](ch15-02-deref.md) + - [使用 `Drop` Trait 运行清理代码](ch15-03-drop.md) + - [`Rc` 引用计数智能指针](ch15-04-rc.md) + - [`RefCell` 与内部可变性模式](ch15-05-interior-mutability.md) + - [引用循环会导致内存泄漏](ch15-06-reference-cycles.md) - [无畏并发](ch16-00-concurrency.md) - - [使用线程同时地运行代码](ch16-01-threads.md) - - [使用消息传递在线程间通信](ch16-02-message-passing.md) - - [共享状态并发](ch16-03-shared-state.md) - - [使用 `Sync` 与 `Send` Traits 的可扩展并发](ch16-04-extensible-concurrency-sync-and-send.md) + - [使用线程同时地运行代码](ch16-01-threads.md) + - [使用消息传递在线程间通信](ch16-02-message-passing.md) + - [共享状态并发](ch16-03-shared-state.md) + - [使用 `Sync` 与 `Send` Traits 的可扩展并发](ch16-04-extensible-concurrency-sync-and-send.md) - [Async 和 await](ch17-00-async-await.md) - - [Futures 和 async 语法](ch17-01-futures-and-syntax.md) - - [并发与 async](ch17-02-concurrency-with-async.md) - - [使用任意数量的 futures](ch17-03-more-futures.md) - - [流(Streams)](ch17-04-streams.md) - - [深入理解 async 相关的 traits](ch17-05-traits-for-async.md) - - [Futures,任务(tasks)和线程(threads)](ch17-06-futures-tasks-threads.md) + - [Futures 和 async 语法](ch17-01-futures-and-syntax.md) + - [并发与 async](ch17-02-concurrency-with-async.md) + - [使用任意数量的 futures](ch17-03-more-futures.md) + - [流(Streams)](ch17-04-streams.md) + - [深入理解 async 相关的 traits](ch17-05-traits-for-async.md) + - [future、任务和线程](ch17-06-futures-tasks-threads.md) - [Rust 的面向对象编程特性](ch18-00-oop.md) - - [面向对象语言的特点](ch18-01-what-is-oo.md) - - [顾及不同类型值的 trait 对象](ch18-02-trait-objects.md) - - [面向对象设计模式的实现](ch18-03-oo-design-patterns.md) + - [面向对象语言的特点](ch18-01-what-is-oo.md) + - [顾及不同类型值的 trait 对象](ch18-02-trait-objects.md) + - [面向对象设计模式的实现](ch18-03-oo-design-patterns.md) ## 高级主题 - [模式与模式匹配](ch19-00-patterns.md) - - [所有可能会用到模式的位置](ch19-01-all-the-places-for-patterns.md) - - [Refutability(可反驳性): 模式是否会匹配失效](ch19-02-refutability.md) - - [模式语法](ch19-03-pattern-syntax.md) + - [所有可能会用到模式的位置](ch19-01-all-the-places-for-patterns.md) + - [Refutability(可反驳性): 模式是否会匹配失效](ch19-02-refutability.md) + - [模式语法](ch19-03-pattern-syntax.md) - [高级特性](ch20-00-advanced-features.md) - - [不安全的 Rust](ch20-01-unsafe-rust.md) - - [高级 trait](ch20-03-advanced-traits.md) - - [高级类型](ch20-04-advanced-types.md) - - [高级函数与闭包](ch20-05-advanced-functions-and-closures.md) - - [宏](ch20-06-macros.md) + - [不安全的 Rust](ch20-01-unsafe-rust.md) + - [高级 trait](ch20-03-advanced-traits.md) + - [高级类型](ch20-04-advanced-types.md) + - [高级函数与闭包](ch20-05-advanced-functions-and-closures.md) + - [宏](ch20-06-macros.md) - [最后的项目:构建多线程 web server](ch21-00-final-project-a-web-server.md) - - [建立单线程 web server](ch21-01-single-threaded.md) - - [将单线程 server 变为多线程 server](ch21-02-multithreaded.md) - - [优雅停机与清理](ch21-03-graceful-shutdown-and-cleanup.md) + - [建立单线程 web server](ch21-01-single-threaded.md) + - [将单线程 server 变为多线程 server](ch21-02-multithreaded.md) + - [优雅停机与清理](ch21-03-graceful-shutdown-and-cleanup.md) - [附录](appendix-00.md) - - [A - 关键字](appendix-01-keywords.md) - - [B - 运算符与符号](appendix-02-operators.md) - - [C - 可派生的 trait](appendix-03-derivable-traits.md) - - [D - 实用开发工具](appendix-04-useful-development-tools.md) - - [E - 版本](appendix-05-editions.md) - - [F - 本书译本](appendix-06-translation.md) - - [G - Rust 是如何开发的与 “Nightly Rust”](appendix-07-nightly-rust.md) + - [A - 关键字](appendix-01-keywords.md) + - [B - 运算符与符号](appendix-02-operators.md) + - [C - 可派生的 trait](appendix-03-derivable-traits.md) + - [D - 实用开发工具](appendix-04-useful-development-tools.md) + - [E - 版本](appendix-05-editions.md) + - [F - 本书译本](appendix-06-translation.md) + - [G - Rust 是如何开发的与 “Nightly Rust”](appendix-07-nightly-rust.md) diff --git a/src/ch09-03-to-panic-or-not-to-panic.md b/src/ch09-03-to-panic-or-not-to-panic.md index 4cbbc85..0842c8a 100644 --- a/src/ch09-03-to-panic-or-not-to-panic.md +++ b/src/ch09-03-to-panic-or-not-to-panic.md @@ -63,7 +63,7 @@ 文件名:src/lib.rs ```rust -{{#rustdoc_include ../listings/ch09-error-handling/listing-09-13/src/lib.rs}} +{{#rustdoc_include ../listings/ch09-error-handling/listing-09-13/src/guessing_game.rs}} ``` 示例 9-13:一个 `Guess` 类型,它只在值位于 1 和 100 之间时才继续 diff --git a/src/ch14-03-cargo-workspaces.md b/src/ch14-03-cargo-workspaces.md index fdad46a..036d785 100644 --- a/src/ch14-03-cargo-workspaces.md +++ b/src/ch14-03-cargo-workspaces.md @@ -20,14 +20,15 @@ $ cd add 文件名:Cargo.toml ```toml -{{#include ../listings/ch14-more-about-cargo/no-listing-01-workspace-with-adder-crate/add/Cargo.toml}} +{{#include ../listings/ch14-more-about-cargo/no-listing-01-workspace/add/Cargo.toml}} ``` 接下来,在 *add* 目录运行 `cargo new` 新建 `adder` 二进制 crate: ```console $ cargo new adder - Created binary (application) `adder` package + Creating binary (application) `adder` package + Adding `adder` as member of workspace at `file:///projects/add` ``` 到此为止,可以运行 `cargo build` 来构建工作空间。*add* 目录中的文件应该看起来像这样: diff --git a/src/ch17-01-futures-and-syntax.md b/src/ch17-01-futures-and-syntax.md index 04f3af5..509ccd6 100644 --- a/src/ch17-01-futures-and-syntax.md +++ b/src/ch17-01-futures-and-syntax.md @@ -155,7 +155,11 @@ error[E0752]: `main` function is not allowed to be `async` 当我们运行代码,我们会得到最初预想的行为: ```console -{{#include ../listings/ch17-async-await/listing-17-04/output.txt}} +$ cargo run -- https://www.rust-lang.org + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s + Running `target/debug/async_await 'https://www.rust-lang.org'` +The title for https://www.rust-lang.org was + Rust Programming Language ``` 我们终于有了一些可以正常工作的异步代码!现在它们可以成功编译并运行。在我们添加代码让两个网址进行竞争之前,让我们简要地回顾一下 future 是如何工作的。 diff --git a/src/title-page.md b/src/title-page.md index ccb6915..4c7080c 100644 --- a/src/title-page.md +++ b/src/title-page.md @@ -6,16 +6,15 @@ **本书的英文原版作者为 Steve Klabnik 和 Carol Nichols,并由 Rust 社区补充完善。本简体中文译本由 Rust 中文社区翻译。** -本书假设你使用 Rust 1.78.0(2024-05-02 发布)或更新的版本。请查看 [第 1 章的 “安装” 部分][install] 了解如何安装和升级 Rust。 +本书的当前版本假设你使用 Rust 1.85.0(2025-02-17 发布)或更高版本并在所有项目的 Cargo.toml 文件中通过 `edition = "2024"`将其配置为使用 Rust 2024 edition 惯用法。请查看[第一章的 “安装” 部分][install]了解如何安装和升级 Rust。 本书的英文原版 HTML 格式可以在 [https://doc.rust-lang.org/stable/book/](https://doc.rust-lang.org/stable/book/) 在线阅读;使用 `rustup` 安装的 Rust 也包含一份英文离线版,运行 `rustup docs --book` 即可打开。 本书还有一些社区 [翻译版本][translations]。简体中文译本可以在 [https://kaisery.github.io/trpl-zh-cn/](https://kaisery.github.io/trpl-zh-cn/) 在线阅读。 -本书也有 [由 No Starch Press 出版的纸质版和电子版][nsprust]。 +本书也有[由 No Starch Press 出版的纸质版和电子版][nsprust]。 [install]: ch01-01-installation.html -[editions]: appendix-05-editions.html [nsprust]: https://nostarch.com/rust-programming-language-2nd-edition [translations]: appendix-06-translation.html