Closed savar closed 1 year ago
This has been fixed in the upstream repo. https://github.com/rust-lang/book/pull/3310
Yeah at some point I need to sync this with the upstream, which is going to be a bit painful..
Just merged upstream, so this should be fixed.
https://github.com/cognitive-engineering-lab/rust-book/blob/c03097b089b214df802c0e628dfc7d87efb80bb2/listings/ch20-web-server/listing-20-24/src/lib.rs#LL73C13-L74C1
the final code uses
let message = ...; match message { .. }
which will still allow concurrency, but the "match" directly on the receiver.lock() will block the concurrency.