Closed
Description
Description
Recently I was looking in the docs for FilterMap, where it says:
fn filter_map<B>(|B|: 'r -> Option<B>) -> FilterMap<'r, B, B, FilterMap<'a, A, B, T>>
However, it seems that not all B
's must be the same type. The definition of filter_map
is namely:
fn filter_map<'r, B>(self, f: |A|: 'r -> Option<B>) -> FilterMap<'r, A, B, Self>
I believe this is due to the fact that the function filter_map
is implemented for Iterator<A>
and that FilterMap implements Iterator<B>
.