How do I idiomatically convert an Option to a bool in Rust in a one liner?

Viewed 770

An option can be converted to a bool using the following code :

match some_opt {
    Some(_) => true,
    None => false,
}

Is there a more concise one-liner way to do this ?

1 Answers
Related