rust-lang / hashbrown

Rust port of Google's SwissTable hash map
https://rust-lang.github.io/hashbrown
Apache License 2.0
2.46k stars 288 forks source link

Implement Default for iterators #542

Closed clarfonthey closed 3 months ago

clarfonthey commented 4 months ago

See rust-lang/rust#128261 for a similar PR for some libstd iterators. In order to do a similar PR for the HashSet and HashMap types, we need to make these changes to hashbrown first to actually implement them.

One small caveat is that I chose to only implement Default for RawIter and not RawIterRange, since it really exists as an implementation detail anyway, and the best implementation would involve just using the RawIter implementation anyway.

JustForFun88 commented 3 months ago

As far as I remember, parallel iterator (rayon) uses RawIterRange directly, so maybe it would be nice to implement Default for RawIterRange too.

clarfonthey commented 3 months ago

That would be a bit difficult for a pub(crate) iterator.

Amanieu commented 3 months ago

@bors r+

bors commented 3 months ago

:pushpin: Commit abd706ec35e699653cd176a7a817bd3100e71c00 has been approved by Amanieu

It is now in the queue for this repository.

bors commented 3 months ago

:hourglass: Testing commit abd706ec35e699653cd176a7a817bd3100e71c00 with merge f677701e261d497ad72216cefa69fd89b73164cc...

bors commented 3 months ago

:sunny: Test successful - checks-actions Approved by: Amanieu Pushing f677701e261d497ad72216cefa69fd89b73164cc to master...