4

Implement Default for some alloc/core iterators by the8472 · Pull Request #99929...

 1 year ago
source link: https://github.com/rust-lang/rust/pull/99929
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Contributor

@the8472 the8472 commented on Jul 30

edited

Add Default impls to the following collection iterators:

  • slice::{Iter, IterMut}
  • binary_heap::IntoIter
  • btree::map::{Iter, IterMut, Keys, Values, Range, IntoIter, IntoKeys, IntoValues}
  • btree::set::{Iter, IntoIter, Range}
  • linked_list::IntoIter
  • vec::IntoIter

and these adapters:

  • adapters::{Chain, Cloned, Copied, Rev, Enumerate, Flatten, Fuse, Rev}

For iterators which are generic over allocators it only implements it for the global allocator because we can't conjure an allocator from nothing or would have to turn the allocator field into an Option just for this change.

These changes will be insta-stable.

ACP: rust-lang/libs-team#77

All reactions

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK