Open
Description
Description
map_flatten
could suggest flatten()
on map(|a| a.into_iter()).flatten()
instead of flat_map(|b| b.into_iter())
.
Example:
use bytes::Bytes;
pub fn flatten_bytes_seq(bytes_collection: Vec<Bytes>) -> Bytes {
bytes_collection.into_iter().map(|b| b.into_iter()).flatten().collect()
}
can be
use bytes::Bytes;
pub fn flatten_bytes_seq(bytes_collection: Vec<Bytes>) -> Bytes {
bytes_collection.into_iter().flatten().collect()
}
version: 1.75.0 on playground
Version
No response
Additional Labels
@rustbot label +C-enhancement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment