Enable clippy::manual_flatten (#8739)

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

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-03-02 20:28:26 -05:00 committed by GitHub
parent f79f56f8b4
commit 503bebaacc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 33 deletions

View file

@ -3713,7 +3713,7 @@ fn open_items(
project_paths_to_open
.into_iter()
.enumerate()
.map(|(i, (abs_path, project_path))| {
.map(|(ix, (abs_path, project_path))| {
let workspace = workspace.clone();
cx.spawn(|mut cx| {
let fs = app_state.fs.clone();
@ -3721,7 +3721,7 @@ fn open_items(
let file_project_path = project_path?;
if fs.is_file(&abs_path).await {
Some((
i,
ix,
workspace
.update(&mut cx, |workspace, cx| {
workspace.open_path(file_project_path, None, true, cx)
@ -3739,10 +3739,8 @@ fn open_items(
let tasks = tasks.collect::<Vec<_>>();
let tasks = futures::future::join_all(tasks.into_iter());
for maybe_opened_path in tasks.await.into_iter() {
if let Some((i, path_open_result)) = maybe_opened_path {
opened_items[i] = Some(path_open_result);
}
for (ix, path_open_result) in tasks.await.into_iter().flatten() {
opened_items[ix] = Some(path_open_result);
}
Ok(opened_items)