PacktPublishing / Rust-Web-Programming-2nd-Edition

Rust Web Programming - Second Edition, published by Packt
MIT License
120 stars 38 forks source link

chapter15/chaining_communication_between_actors/server does not run #4

Open WillAyd opened 1 year ago

WillAyd commented 1 year ago

Using rustc 1.63.0 you get a few errors when trying to build chapter 15/chaining_communication_between_actors/server which are present in the book. As far as I can tell:

  1. mod order_tracker may be missing from main.rs, which prevents resolution to that package
  2. The TrackerMessage constructor in actor.rs:46 provides 4 arguments, but the TrackerMessage itself has only 2 struct members (ticker and amount are different). I think you mean to provide something like:
            let tracker_message = TrackerMessage {
                command: Order::BUY(message.ticker, message.amount),
                respond_to: send,
            };

after importing Order from the order_tracker module. When I walked through the documentation I still had an Order enum with a different definition already in actor.rs - I don't think it was clear to ever get rid of this

  1. The updates to main.rs highlighted in the book do not reflect in the main.rs in the repository
  2. In the book there is a code block for main.rs that reads:
let get_actor =
    GetTrackerActor{sender: tracker_tx_two.clone()};

However, tracker_tx_two does not exist.

Sorry if this is the wrong place to submit Errata - I read the book via O'Reilly and didn't see an errata submission there, so figured this was the next best place. I have found the book to be very enlightening so thank you for all of your efforts