Is there an idiom in Rust which is used to assign the value of a variable based on a match clause? I know something like
val b = a match {
case x if x % 2 == 1 => false
case _ => true
}
from Scala and was wondering whether you can do the same in Rust. Is there a way to evaluate a match clause as an expression and return something from it or is it just a statement in Rust?