-
Notifications
You must be signed in to change notification settings - Fork 184
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
Conversation
This shouldn't pass, right? E.g. /~https://github.com/n0-computer/iroh/blob/main/iroh-net/src/magicsock.rs#L2011 |
Depends on a newly stabilized feature which will be in 1.75 and available on nightly today rust-lang/cargo#12115 (comment)
425c6cf
to
3f9c73b
Compare
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. |
@rklaehn I added some exceptions in the |
They are async for 2 reasons:
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. |
will rebase and merge once the current work around magicsock settles down a little bit 😅 |
3f9c73b
to
92fc64d
Compare
Details: https://rust-lang.github.io/rust-clippy/master/index.html#/unused_async