Y
Hacker News
new
|
ask
|
show
|
jobs
by
johannkokos
2622 days ago
Just like C++, your filter can be simplified like,
filter(|string| {set.insert(string)}
as insert return a bool.
1 comments
nicoburns
2622 days ago
Oo, I didn't realise that. Super handy. I've updated my snippet to make use of your suggestion :)
link