Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clippy: warn on unsused async fn #1743

Merged
merged 6 commits into from
Oct 30, 2023
Merged

Conversation

dignifiedquire
Copy link
Contributor

@Frando
Copy link
Member

Frando commented Oct 26, 2023

@dignifiedquire dignifiedquire force-pushed the clippy-warn-unused-async branch from 425c6cf to 3f9c73b Compare October 26, 2023 19:07
@rklaehn
Copy link
Contributor

rklaehn commented Oct 27, 2023

I can not put in words how much I love this lint.

So many times where you have some code that you wish to be sync but you can't do that because it calls some code that is async.

This alone puts the cost/benefit ratio of clippy solidly in the positive despite all my complaints.

@dignifiedquire
Copy link
Contributor Author

@rklaehn I added some exceptions in the iroh-bytes code, is that the right way, or should I change those functions?

@rklaehn
Copy link
Contributor

rklaehn commented Oct 27, 2023

@rklaehn I added some exceptions in the iroh-bytes code, is that the right way, or should I change those functions?

They are async for 2 reasons:

  1. it used to be a trait
  2. if we want to lazily load hash seqs, we would need them to be async

So I think they should remain async because of 2. Eventually we will want to lazily load them, but I did not see much urgency since so far we don't have HashSeqs with billions of entries.

@dignifiedquire
Copy link
Contributor Author

will rebase and merge once the current work around magicsock settles down a little bit 😅

@dignifiedquire dignifiedquire force-pushed the clippy-warn-unused-async branch from 3f9c73b to 92fc64d Compare October 30, 2023 10:48
@dignifiedquire dignifiedquire added this to the v0.9.0 milestone Oct 30, 2023
@dignifiedquire dignifiedquire added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit 7068f33 Oct 30, 2023
15 checks passed
@dignifiedquire dignifiedquire deleted the clippy-warn-unused-async branch October 30, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants