]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #105453 - scottmcm:vecdeque_from_iter, r=the8472
authorMatthias Krüger <matthias.krueger@famsik.de>
Fri, 9 Dec 2022 21:31:56 +0000 (22:31 +0100)
committerGitHub <noreply@github.com>
Fri, 9 Dec 2022 21:31:56 +0000 (22:31 +0100)
commit5156fbdc74cbf9902a96bafd27775f4764d5bfde
tree30555bb7714e26c66e1334ca6739ce4f90811a4a
parentc44326e8b5b42be207d12713d594660d0f19c739
parent6648134434fe4ac69132852e6d58f15578bfc022
Rollup merge of #105453 - scottmcm:vecdeque_from_iter, r=the8472

Make `VecDeque::from_iter` O(1) from `vec(_deque)::IntoIter`

As suggested in https://github.com/rust-lang/rust/pull/105046#issuecomment-1330371695 by
r? ``@the8472``

`Vec` & `VecDeque`'s `IntoIter`s own the allocations, and even if advanced can be turned into `VecDeque`s in O(1).

This is just a specialization, not an API or doc commitment, so I don't think it needs an FCP.