From c36ae932f901d452e78e1dd69400f6b2169c8fa7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 16 Feb 2024 16:08:01 -0800 Subject: [PATCH] Clarify the flatten specialization comment --- library/core/src/iter/adapters/flatten.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/iter/adapters/flatten.rs b/library/core/src/iter/adapters/flatten.rs index 64a2ca3d2b870..145c9d3dacc84 100644 --- a/library/core/src/iter/adapters/flatten.rs +++ b/library/core/src/iter/adapters/flatten.rs @@ -917,10 +917,10 @@ where } } -// Specialization: For iterators that never return more than one item, the `frontiter` and +// Specialization: When the inner iterator `U` never returns more than one item, the `frontiter` and // `backiter` states are a waste, because they'll always have already consumed their item. So in // this impl, we completely ignore them and just focus on `self.iter`, and we only call the inner -// `next()` one time. +// `U::next()` one time. // // It's mostly fine if we accidentally mix this with the more generic impls, e.g. by forgetting to // specialize one of the methods. If the other impl did set the front or back, we wouldn't see it