Understanding the Python list is really simple:
>>> l = [x for x in range(1, 10) if x % 2 == 0] >>> [2, 4, 6, 8]
Does Rust have the same syntax as:
let vector = vec![x for x in (1..10) if x % 2 == 0]
syntax list-comprehension rust iterable
Darkaird
source share