Ich, einfach anders@lemmings.worldtoRust@programming.dev•Rust Optimization: `Vec::into_iter().collect()`
1·
9 months agoTo be fair, these alternatives are also limited to the case where the item type stays the same.
To be fair, these alternatives are also limited to the case where the item type stays the same.
map()
can still be used with Vec::iter_mut()
, filter_map()
can be replaced with Vec::retain_mut()
.
I think the better solution would be to use Vec::retain()
.
Tl;dr: std::process::Command
is vulnerable to shell injection if you invoke cmd.exe
or *.{cmd,bat}
on Windows.
That’s just brilliant.