Skip to content

Commit

Permalink
Fix clippy::return_self_not_must_use warning
Browse files Browse the repository at this point in the history
```text
error: missing `#[must_use]` attribute on a method returning `Self`
  --> futures-util/src/stream/select_with_strategy.rs:19:5
   |
19 | /     pub fn toggle(&mut self) -> Self {
20 | |         let old = *self;
21 | |
22 | |         match self {
...  |
27 | |         old
28 | |     }
   | |_____^
   |
```
  • Loading branch information
taiki-e committed Dec 18, 2021
1 parent cb3c515 commit 6edf1a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions futures-util/src/stream/select_with_strategy.rs
Expand Up @@ -16,6 +16,7 @@ pub enum PollNext {

impl PollNext {
/// Toggle the value and return the old one.
#[must_use]
pub fn toggle(&mut self) -> Self {
let old = *self;

Expand Down

0 comments on commit 6edf1a7

Please sign in to comment.