Closed
Description
hi, it seems to me that max_by_key is wrong.
i'm not 100% sure since I just started playing with futures and the error messages are kind of harsher than I'm used to.
the doc seems wrong to me :
let s = stream::from_iter(vec![-1isize, -2, -3]);
let max = s.clone().max_by_key(|x| x.abs()).await;
assert_eq!(max, Some(3));
I would expect a max of -3 and not 3.
also in the source code, the MaxByKeyFuture has a key_by fn which returns a S::Item and not a B
Metadata
Metadata
Assignees
Labels
No labels