This seems like it should be relatively straightforward, but I'm at a loss on how to accomplish this.
let filename = path .and_then(|name| name.file_name()) .and_then(|name| name.to_str()) .unwrap_or("default");
But I get
error[E0515]: cannot return value referencing function parameter `name`
And I don't know what to do from here.