Github Implement more Iterator methods on core::iter::Repeat by lopopolo · Pull...
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.
core::iter::Repeat
always returns the same element, which means we can
do better than implementing most Iterator
methods in terms ofIterator::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
.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK