From 4da9f1069f16ec06912f85f0ca684f09f36d45a7 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 12 Nov 2018 12:22:33 +0100 Subject: [PATCH] Document optimizations enabled by FusedIterator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When reading this I wondered what “some significant optimizations” referred to. As far as I can tell, the specialization of `.fuse()` is the only case where `FusedIterator` has any impact at all. Is this accurate @Stebalien? --- src/libcore/iter/traits.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/iter/traits.rs b/src/libcore/iter/traits.rs index f95f8e7dbcbb6..d2c5a3bed2869 100644 --- a/src/libcore/iter/traits.rs +++ b/src/libcore/iter/traits.rs @@ -960,7 +960,7 @@ impl Product> for Result /// /// 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`]