For in where statement

Does Rust support or have an equivalent to?

for x in values where x == true {}

I've used this in Swift previously and thought it was nice. Perhaps there is an excepted way in Rust? I did look, but couldn't see? I've actually only ever come across this in Swift, but I'm a Rustacean now :slight_smile:

Typically filter is used here. There's no built in language feature.

1 Like