Skip to content

Commit

Permalink
fix lint warning after Rust update
Browse files Browse the repository at this point in the history
Summary:
We are now using Rust 1.81.0. The new lint warning:

```
warning: this function depends on never type fallback being `()`
```

Forces us to use explicit types in `try_collect` when we're collecting over
fuctions returning unit types. (Previously that was a never type which was
implicitly casted to unit type).

More context: rust-lang/rust#123748

Reviewed By: diliop

Differential Revision: D64007786

fbshipit-source-id: e7da6827b799053a4a37247e80ccf9f36636d20a
  • Loading branch information
mitrandir77 authored and facebook-github-bot committed Oct 7, 2024
1 parent 5a8ebf3 commit 194de6d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion eden/mononoke/blobstore/packblob/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl<T: Blobstore + BlobstoreUnlinkOps> PackBlob<T> {
let key = format!("{}{}{}", key_prefix, key, ENVELOPE_SUFFIX);
links.push(self.inner.copy(ctx, &pack_key, key));
}
links.try_collect().await?;
links.try_collect::<()>().await?;

// remove the pack key, so that only the entries links are keeping it live
self.inner.unlink(ctx, &pack_key).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ where
}
})
.buffer_unordered(100)
.try_collect()
.try_collect::<()>()
.await?;

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion eden/mononoke/git/import_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ pub async fn import_commit_contents<Uploader: GitUploader, Reader: GitReader>(
}
})
.try_buffer_unordered(100)
.try_collect()
.try_collect::<()>()
.await?;
// Upload packfile base item for Git commit and the raw Git commit
let packfile_item_upload = async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ pub async fn upload_commits<'a>(
copy_file_contents(ctx, sm_repo.as_ref(), target_repo, content_ids, |_| {}).await
})
.buffer_unordered(10)
.try_collect()
.try_collect::<()>()
.await?;

// Then copy from source repo
Expand Down
2 changes: 1 addition & 1 deletion eden/mononoke/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ fn main(fb: FacebookInit) -> Result<()> {
// Repo cache warmup can be quite expensive, let's limit to 40
// at a time.
.buffer_unordered(40)
.try_collect()
.try_collect::<()>()
.await?;
info!(&root_log, "Cache warmup completed");
if let Some(mut executor) = args.sharded_executor_args.build_executor(
Expand Down

0 comments on commit 194de6d

Please sign in to comment.