hyperium / http

Rust HTTP types
Apache License 2.0
1.15k stars 285 forks source link

Override some provided `Iterator` methods for header map's `Keys` #667

Closed LukasKalbertodt closed 8 months ago

LukasKalbertodt commented 8 months ago

The inner iterator is simply a slice::Iter, so all of these can be done in constant time. Ideally, we would override advance_by, but that's still unstable.

With this, it is possible to build a poor man's retain, which was requested in #541. On that topic: would you be open to merge a PR adding retain? Then I might start working on that.