I don't know. I find this:
fn get_ids(data: Vec<Widget>) -> Vec<Id> {
let mut result = Vec::new();
for widget in &data {
if widget.alive {
result.push(widget.id);
}
}
result
}
more readable than this: fn get_ids(data: Vec<Widget>) -> Vec<Id> {
data.iter()
.filter(|w| w.alive)
.map(|w| w.id)
.collect()
}
and I also dislike Rust requiring you to write "mut" for function mutable values. It's mostly just busywork and dogma.