mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-09-05 07:28:04 +08:00
perf: 移除不必要的 Vec,略微提升性能 (#682)
This commit is contained in:
@@ -171,7 +171,7 @@ pub async fn fetch_video_details(
|
|||||||
Ok::<_, anyhow::Error>(())
|
Ok::<_, anyhow::Error>(())
|
||||||
})
|
})
|
||||||
.collect::<FuturesUnordered<_>>();
|
.collect::<FuturesUnordered<_>>();
|
||||||
tasks.try_collect::<Vec<_>>().await?;
|
tasks.try_collect::<()>().await?;
|
||||||
video_source.log_fetch_video_end();
|
video_source.log_fetch_video_end();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@@ -688,7 +688,7 @@ pub async fn fetch_page_subtitle(
|
|||||||
tokio::fs::write(path, subtitle.body.to_string()).await
|
tokio::fs::write(path, subtitle.body.to_string()).await
|
||||||
})
|
})
|
||||||
.collect::<FuturesUnordered<_>>();
|
.collect::<FuturesUnordered<_>>();
|
||||||
tasks.try_collect::<Vec<()>>().await?;
|
tasks.try_collect::<()>().await?;
|
||||||
Ok(ExecutionStatus::Succeeded)
|
Ok(ExecutionStatus::Succeeded)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -750,7 +750,7 @@ pub async fn fetch_upper_face(
|
|||||||
Ok::<(), anyhow::Error>(())
|
Ok::<(), anyhow::Error>(())
|
||||||
})
|
})
|
||||||
.collect::<FuturesUnordered<_>>();
|
.collect::<FuturesUnordered<_>>();
|
||||||
tasks.try_collect::<Vec<()>>().await?;
|
tasks.try_collect::<()>().await?;
|
||||||
Ok(ExecutionStatus::Succeeded)
|
Ok(ExecutionStatus::Succeeded)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,7 +772,7 @@ pub async fn generate_upper_nfo(
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect::<FuturesUnordered<_>>();
|
.collect::<FuturesUnordered<_>>();
|
||||||
tasks.try_collect::<Vec<()>>().await?;
|
tasks.try_collect::<()>().await?;
|
||||||
Ok(ExecutionStatus::Succeeded)
|
Ok(ExecutionStatus::Succeeded)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user