Enable clippy::map_flatten (#8733)

This PR enables the
[`clippy::map_flatten`](https://rust-lang.github.io/rust-clippy/master/index.html#/map_flatten)
rule and fixes the outstanding violations.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2024-03-02 18:24:22 -05:00
committed by GitHub
parent 8bc35c33c5
commit eaf2fbb21b
10 changed files with 13 additions and 26 deletions
+1 -2
View File
@@ -4083,8 +4083,7 @@ mod tests {
.position_map
.line_layouts
.iter()
.map(|line_with_invisibles| &line_with_invisibles.invisibles)
.flatten()
.flat_map(|line_with_invisibles| &line_with_invisibles.invisibles)
.cloned()
.collect()
}
+1 -2
View File
@@ -688,7 +688,7 @@ mod tests {
// add all kinds of inlays between two word boundaries: we should be able to cross them all, when looking for another boundary
let mut id = 0;
let inlays = (0..buffer_snapshot.len())
.map(|offset| {
.flat_map(|offset| {
[
Inlay {
id: InlayId::Suggestion(post_inc(&mut id)),
@@ -712,7 +712,6 @@ mod tests {
},
]
})
.flatten()
.collect();
let snapshot = display_map.update(cx, |map, cx| {
map.splice_inlays(Vec::new(), inlays, cx);