7

Github Implement more Iterator methods on core::iter::Repeat by lopopolo · Pull...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/85338
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.
neoserver,ios ssh client

Copy link

Contributor

lopopolo commented 19 days ago

edited

core::iter::Repeat always returns the same element, which means we can
do better than implementing most Iterator methods in terms of
Iterator::next.

Fixes #81292.

#81292 raises the question of whether these changes violate the contract of core::iter::Repeat, but as far as I can tell core::iter::repeat doesn't make any guarantees around how it calls Clone::clone.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK