I'm trying to return the result of a format!
after pattern matching an enum
:
enum Enm {
Cont(String)
}
fn call(enm: &Enm) -> &str {
match *enm {
Enm::Cont(ref s) => &format!("{}", s)
}
}
fn main() {
}
But this won't work: borrowed value does not live long enough
How can I solve this?