Hands-on Rust: ambiguous code placement in Chap 9

Title: Hands-on Rusk: Chapter 9 (code to handle attacked)

It’s not clear that this code needs to be placed inside the movers.iter()…for_each() {}. Placing it after the for_each results in variables out of scope (and invalid logic come to think of it. (Guess it’s obvious where I placed it (not thinking)

Edit… managed to get this “double wrong”. It was a good debugging exercise for me, but I think it points to there needing to be more attention on how to point the read to where code needs to be inserted. It’s a bit of an on-going theme, that I put code in the wrong place. (Could be a “just me” thing, so take that into account.)

(Just another post in my quest for “top whiner” badge :slight_smile: )

1 Like

Thanks! Don’t worry about “top whiner” - I appreciate all the feedback. It should make the book better. :slight_smile:

I’ve logged this in the issue tracker. It does look like a few more highlights for “insert here” would help.

1 Like