Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by himata4113

12 hours ago

I am sure there's a way to filter directly on cond variable and collect isn't needed most of the time since iterators are way more useful in general (unless you want to print that data)

   items.filter(cond).map(Pointer::idx)

I know this is possible, but you would have to consult some rust wizard for this.

0 comments

himata4113

Reply

No comments yet

Contribute on Hacker News ↗

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities