Skip to content

Commit ea674ec

Browse files
committed
core: lift FIXME comment from option.rs to iter::try_process
This FIXME is relevant not only to Option but other similar cases that use iter::try_process(). The referenced issue 11084 was closed in 2021, and the related PR 59605 was not merged due to inconclusive results.
1 parent 4efe3dc commit ea674ec

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

library/core/src/iter/adapters/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ where
155155
for<'a> F: FnMut(GenericShunt<'a, I, R>) -> U,
156156
R: Residual<U>,
157157
{
158+
// FIXME(#11084): we might be able to get rid of GenericShunt in favor of
159+
// Iterator::scan, as performance should be comparable
160+
158161
let mut residual = None;
159162
let shunt = GenericShunt { iter, residual: &mut residual };
160163
let value = f(shunt);

library/core/src/option.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,9 +2758,6 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> {
27582758
/// so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16.
27592759
#[inline]
27602760
fn from_iter<I: IntoIterator<Item = Option<A>>>(iter: I) -> Option<V> {
2761-
// FIXME(#11084): This could be replaced with Iterator::scan when this
2762-
// performance bug is closed.
2763-
27642761
iter::try_process(iter.into_iter(), |i| i.collect())
27652762
}
27662763
}

0 commit comments

Comments
 (0)