Hands-on Rust: method name incorrect for my_visitor (greet instead of greet_visitor) (page 31)

From page 31 (PDF):

This function is a member function or method. It accepts self as a parameter,
which is automatically passed into the function when you reference an
instance of the struct (e.g. my_visitor.greet()) with the contents of that specific
structure instance.

My apologies if I misunderstood, but appears that this may have been the intended sentence:

This function is a member function or method. It accepts self as a parameter,
which is automatically passed into the function when you reference an
instance of the struct (e.g. my_visitor.greet_visitor()) with the contents of that specific
structure instance.

I’m really enjoying the book thus far. Thanks for writing it!

1 Like

Glad you’re enjoying the book! I’ve added this to the issue tracker, should have a fix in place for beta 3. Thank you.

2 Likes