Hands-on Rust: Text and code revisions out of sync

Title: Name of book: Hands-on Rust (p. 181) <- using the PDF to make these easier, hope all appreciate my sacrifice :wink:

Beta 4 notes point that you added in_bounds to Algorithms2D (pg 170), but the text right before it still reads:

“Good news: if you’ve followed the examples in this book, you’re using a compatible format and only need to write dimensions() yourself.”


As an additional comment you might inject a bit about why this is done (and why it’s done this way). As a programmer who’s done a LOT of Java, I originally had a “what’s the point of that?” doesn’t look like it does anything (until I thought a bit about how Rust isn’t the same sort of OO as I was used to.)

Though, that said
 why wouldn’t I just move the definition of in_bounds to the implementation for Algorithm2D?? That still puts it on the Map struct, right?

1 Like

Oops - thanks for finding that! I’ll fix that up in the next beta.

1 Like