Say that I have the following trait:
trait SayHello {
fn say_hello(self) -> String;
}
Why can I then do this:
fn say_hello_twice(this: impl SayHello) -> String {
let said_hello = this.say_hello();
said_hello + " " + &said_hello
}
But not this:
impl impl SayHello {
fn say_hello_twice(self) -> String {
let said_hello = self.say_hello();
said_hello + " " + &said_hello
}
}
When the latter is seemingly just syntactic sugar for the former?