In chapter ch10-02-traits.md, notify fn is defined as follow:
pub fn notify(item: impl Summary) {
println!("Breaking news! {}", item.summarize());
}
instead of
pub fn notify(item: &impl Summary) {
println!("Breaking news! {}", item.summarize());
}
I see the same pattern being used for explaining trait bounds. Is there any particular reason we don't seem to prefer references?
Personally, when I looked at these examples, I started asking questions like
- why is this defined to move an object?
- Is author trying to communicate that these methods can only be invoked once. If so, why?
I am more than happy to do the changes if anyone feels in the same manner and it improves readability.
Thanks.