Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Aug 21, 2024
1 parent 0c2844c commit be1d012
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/freighter-fs-index/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::type_complexity)]
use anyhow::Context;
use async_trait::async_trait;
use chrono::Utc;
Expand Down Expand Up @@ -249,10 +250,10 @@ impl IndexProvider for FsIndexProvider {

async fn list(&self, _pagination: &ListQuery) -> IndexResult<ListAll> {
let index_keys = self.fs.list_prefix("index/").await?;
let mut results = Vec::with_capacity(index_keys.len());

let mut crate_versions_with_publish =
get_latest_crate_publishes(Arc::clone(&self.fs), index_keys)?;
get_latest_crate_publishes(Arc::clone(&self.fs)).await;
let mut results = Vec::with_capacity(index_keys.len());

while let Some(handle) = crate_versions_with_publish.join_next().await {
let publish_fetch_result = handle.context("index fetch task unexpectedly failed")?;
Expand All @@ -279,7 +280,7 @@ impl IndexProvider for FsIndexProvider {
let mut results = Vec::with_capacity(index_keys.len());

let mut crate_versions_with_publish =
get_latest_crate_publishes(Arc::clone(&self.fs), index_keys)?;
get_latest_crate_publishes(Arc::clone(&self.fs), index_keys);

while let Some(handle) = crate_versions_with_publish.join_next().await {
let Ok(Ok((mut versions, publish_meta))) = handle else { continue };
Expand All @@ -301,7 +302,7 @@ impl IndexProvider for FsIndexProvider {
fn get_latest_crate_publishes(
fs: Arc<dyn MetadataStorageProvider + Send + Sync>,
index_keys: Vec<String>,
) -> IndexResult<JoinSet<IndexResult<(Vec<CrateVersion>, Option<Publish>)>>> {
) -> JoinSet<IndexResult<(Vec<CrateVersion>, Option<Publish>)>> {
let mut join_set = JoinSet::new();

for index_key in index_keys {
Expand All @@ -317,7 +318,7 @@ fn get_latest_crate_publishes(
});
}

Ok(join_set)
join_set
}

fn convert_publish_to_crate_entry(
Expand Down

0 comments on commit be1d012

Please sign in to comment.