For in where statement


#1

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:


#2

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