Obviously still don't understand

Error msg:
Mismatched types, expected &str found struct String.

I, up until now was convinced that if method has a signature:

fn do_something(argument: &str);

then we could pass both, &str and String to that method.
How is it that the compiler complains?

Not String, but &String.

You can pass a &String to it, not a String.

1 Like