From c63e0bd939d285eff9d262b45a55ac81be114ef3 Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Thu, 24 Mar 2022 22:09:24 +0000 Subject: [PATCH] Use PollNext::other() in PollNext::toggle() --- futures-util/src/stream/select_with_strategy.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/futures-util/src/stream/select_with_strategy.rs b/futures-util/src/stream/select_with_strategy.rs index c553a36752..c7ad992fbc 100644 --- a/futures-util/src/stream/select_with_strategy.rs +++ b/futures-util/src/stream/select_with_strategy.rs @@ -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 }