Early-breaking from Rust's match
问题 I want to switch through many possible cases for x and there's one case (here x == 0 ) where I want to check the result of some additional code to determine what to do next. One possibility is to return early from the match. I'd use break to do this early-returning in C, but this isn't allowed in Rust. return returns from the parent function (in this case main() ) and not from the match only (i.e. the println! at the end isn't run!). I could just negate the sub-condition (here y == 0 ) and