Skip to content

Commit

Permalink
Rollup merge of rust-lang#55896 - rust-lang:opt-fuse, r=shepmaster
Browse files Browse the repository at this point in the history
Document optimizations enabled by FusedIterator

When reading this I wondered what “some significant optimizations” referred to. As far as I can tell from reading code, the specialization of `.fuse()` is the only case where `FusedIterator` has any impact at all. Is this accurate @Stebalien?
  • Loading branch information
kennytm committed Nov 13, 2018
2 parents 99986a5 + 4da9f10 commit 4d76440
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/iter/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ impl<T, U, E> Product<Result<U, E>> for Result<T, E>
///
/// Calling next on a fused iterator that has returned `None` once is guaranteed
/// to return [`None`] again. This trait should be implemented by all iterators
/// that behave this way because it allows for some significant optimizations.
/// that behave this way because it allows optimizing [`Iterator::fuse`].
///
/// Note: In general, you should not use `FusedIterator` in generic bounds if
/// you need a fused iterator. Instead, you should just call [`Iterator::fuse`]
Expand Down

0 comments on commit 4d76440

Please sign in to comment.