I am reading The Rust Programming Language, and I am stuck at trait bound syntax:
pub trait Summary {
fn summarize(&self) -> String;
}
pub fn notify1(item1: &impl Summary, item2: &impl Summary) {}
pub fn notify2<T: Summary>(item1: &T, item2: &T) {}
We use trait Summary to bound the parameter's type of function notify1 and notify2.
Why do we use impl Summmary in notify1, but use Summary in notify2? I think use Summary in notify1 instead of impl Summary is more natural.