If I try to write this
fn main() {
let foo = return_string().unwrap_or("bar".to_string());
^^^^^^^^^^^^^^^^^
}
fn return_string() -> Option<String> {
Some("baz".to_string())
}
Clippy complains with this message
Arguments passed to `unwrap_or` are eagerly evaluated;
if you are passing the result of a function call,
it is recommended to use [ `unwrap_or_else` ](#),
which is lazily evaluated.
I don't really see a way to get around things of this pattern, where I need a method call in unwrap_or(). what can I do?