book
book copied to clipboard
Ch13-01 Incorrect function name
-
[x] I have checked the latest
mainbranch to see if this has already been fixed -
[x] I have searched existing issues and pull requests for duplicates
URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch13-01-closures.html#capturing-the-environment-with-closures
Description of the problem:
The text says:
The method
shirt_giveawaydefined onInventory
While the listing referenced (13-1) says:
impl Inventory {
fn giveaway(&self, user_preference: Option<ShirtColor>) -> ShirtColor {
user_preference.unwrap_or_else(|| self.most_stocked())
}
fn most_stocked(&self) -> ShirtColor {
// snip
}
}
Suggested fix:
Update the text description to be
The method
giveawaydefined onInventory
The method name in the listing is more appropriate in my opinion