RS.CLIPPY.FLAT_MAP_IDENTITY
Call to `flat_map` where `flatten` is sufficient
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: flat_map_identity. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Checks for usage of flat_map(|x| x).
Why is this bad?
Readability, this can be written more concisely by using flatten.
Example
iter.flat_map(|x| x);
Can be written as
iter.flatten();