mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-13 08:27:14 +00:00
acdf43f257
New lint: `unused_async` changelog: Adds a lint, `unused_async`, which checks for async functions with no await statements `unused_async` is a lint that reduces code smell and overhead by encouraging async functions to be refactored into synchronous functions. Fixes #7176 ### Examples ```rust async fn get_random_number() -> i64 { 4 // Chosen by fair dice roll. Guaranteed to be random. } ``` Could be written as: ```rust fn get_random_number() -> i64 { 4 // Chosen by fair dice roll. Guaranteed to be random. } ``` Something like this, however, should **not** be caught by clippy: ```rust #[async_trait] trait AsyncTrait { async fn foo(); } struct Bar; #[async_trait] impl AsyncTrait for Bar { async fn foo() { println!("bar"); } } ``` |
||
---|---|---|
.. | ||
auxiliary | ||
cargo | ||
ui | ||
ui-cargo | ||
ui-internal | ||
ui-toml | ||
compile-test.rs | ||
dogfood.rs | ||
fmt.rs | ||
integration.rs | ||
lint_message_convention.rs | ||
missing-test-files.rs | ||
versioncheck.rs |