Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FromIterator and IntoIterator impls for ThinVec #83821

Merged
merged 1 commit into from
Apr 6, 2021

Commits on Apr 6, 2021

  1. Add FromIterator and IntoIterator impls for ThinVec

    These should make using `ThinVec` feel much more like using `Vec`.
    They will allow users of `Vec` to switch to `ThinVec` while continuing
    to use `collect()`, `for` loops, and other parts of the iterator API.
    
    I don't know if there were use cases before for using the iterator API
    with `ThinVec`, but I would like to start using `ThinVec` in rustdoc,
    and having it conform to the iterator API would make the transition
    *a lot* easier.
    
    I added a `FromIterator` impl, an `IntoIterator` impl that yields owned
    elements, and `IntoIterator` impls that yield immutable or mutable
    references to elements. I also added some unit tests for `ThinVec`.
    camelid committed Apr 6, 2021
    Configuration menu
    Copy the full SHA
    09ff88b View commit details
    Browse the repository at this point in the history