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: disallow useless asyncs #3513

Merged
merged 26 commits into from
Jun 5, 2024
Merged

clippy: disallow useless asyncs #3513

merged 26 commits into from
Jun 5, 2024

Conversation

bnjbvr
Copy link
Member

@bnjbvr bnjbvr commented Jun 5, 2024

Using async when not required will increase compile times, and propagate async-ness to the callers, transitively.

See also the lint description.

Since we only had a few false positives, I've enabled it by default. This PR is supposed to be squashed-and-merged, there's no point in keeping the individual commits, but these should help with the review.

(Note there's a renaming in the middle too.)

@bnjbvr bnjbvr requested a review from a team as a code owner June 5, 2024 14:30
@bnjbvr bnjbvr requested review from poljar and removed request for a team June 5, 2024 14:30
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 7 lines in your changes missing coverage. Please review.

Project coverage is 83.77%. Comparing base (23cc1e3) to head (515b3c9).

Files Patch % Lines
crates/matrix-sdk-crypto/src/identities/user.rs 42.85% 4 Missing ⚠️
crates/matrix-sdk-crypto/src/identities/device.rs 77.77% 2 Missing ⚠️
crates/matrix-sdk/src/oidc/mod.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3513      +/-   ##
==========================================
+ Coverage   83.75%   83.77%   +0.01%     
==========================================
  Files         254      254              
  Lines       25729    25723       -6     
==========================================
  Hits        21550    21550              
+ Misses       4179     4173       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bnjbvr bnjbvr force-pushed the bnjbvr/clippy-unused-async branch from cf2e0f0 to 515b3c9 Compare June 5, 2024 14:51
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Looks good.

@bnjbvr bnjbvr merged commit 5093af8 into main Jun 5, 2024
38 checks passed
@bnjbvr bnjbvr deleted the bnjbvr/clippy-unused-async branch June 5, 2024 15:13
@Hywan
Copy link
Member

Hywan commented Jun 6, 2024

Oh that's a nice lint!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants