I currently have to use this to format a .expect()
message:
fn main() {
let x: Option<&str> = None;
x.expect(&format!("the world is ending: {}", "foo")[..]);
}
Is there a less verbose way?
See Question&Answers more detail:osI currently have to use this to format a .expect()
message:
fn main() {
let x: Option<&str> = None;
x.expect(&format!("the world is ending: {}", "foo")[..]);
}
Is there a less verbose way?
See Question&Answers more detail:os