diff options
| author | bors <bors@rust-lang.org> | 2023-10-26 21:01:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-26 21:01:40 +0000 |
| commit | 2f0f4ddcf73a82115168d187a5c2121b413e34a2 (patch) | |
| tree | 6905d68c743b60b0c4bef06be884084ae9d590e2 /clippy_utils | |
| parent | 392b2552806d2479cf73f519c0825c44c1fde0e3 (diff) | |
| parent | ebf6667b571568e88e4b8934013515cb69db74e8 (diff) | |
Auto merge of #11698 - a1phyr:waker_clone_and_wake, r=y21
Add `waker_clone_and_wake` lint to check needless `Waker` clones Check for patterns of `waker.clone().wake()` and replace them with `waker.wake_by_ref()`. An alternative name could be `waker_clone_then_wake` changelog: [ `waker_clone_wake`]: new lint
Diffstat (limited to 'clippy_utils')
| -rw-r--r-- | clippy_utils/src/paths.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clippy_utils/src/paths.rs b/clippy_utils/src/paths.rs index 0b0e8cdc9f4..ee0acdecd51 100644 --- a/clippy_utils/src/paths.rs +++ b/clippy_utils/src/paths.rs @@ -112,6 +112,7 @@ pub const VEC_RESIZE: [&str; 4] = ["alloc", "vec", "Vec", "resize"]; pub const INSTANT_NOW: [&str; 4] = ["std", "time", "Instant", "now"]; pub const VEC_IS_EMPTY: [&str; 4] = ["alloc", "vec", "Vec", "is_empty"]; pub const VEC_POP: [&str; 4] = ["alloc", "vec", "Vec", "pop"]; +pub const WAKER: [&str; 4] = ["core", "task", "wake", "Waker"]; pub const OPTION_UNWRAP: [&str; 4] = ["core", "option", "Option", "unwrap"]; pub const OPTION_EXPECT: [&str; 4] = ["core", "option", "Option", "expect"]; #[expect(clippy::invalid_paths)] // not sure why it thinks this, it works so |
