Skip to content

Commit

Permalink
Use PollNext::other() in PollNext::toggle()
Browse files Browse the repository at this point in the history
  • Loading branch information
414owen committed Mar 24, 2022
1 parent b015744 commit c63e0bd
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions futures-util/src/stream/select_with_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ impl PollNext {
#[must_use]
pub fn toggle(&mut self) -> Self {
let old = *self;

match self {
PollNext::Left => *self = PollNext::Right,
PollNext::Right => *self = PollNext::Left,
}

*self = self.other();
old
}

Expand Down

0 comments on commit c63e0bd

Please sign in to comment.