Skip to content

Commit e40bd05

Browse files
committed
Fix clippy::derivable_impls warning
``` error: this `impl` can be derived --> futures-util/src/stream/select_with_strategy.rs:33:1 | 33 | / impl Default for PollNext { 34 | | fn default() -> Self { 35 | | Self::Left 36 | | } 37 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#derivable_impls = note: `-D clippy::derivable-impls` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::derivable_impls)]` help: replace the manual implementation with a derive attribute and mark the default variant | 9 + #[derive(Default)] 10 | pub enum PollNext { 11 | /// Poll the first stream. 12 ~ #[default] 13 ~ Left, | ```
1 parent de9274e commit e40bd05

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

futures-util/src/stream/select_with_strategy.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ use futures_core::task::{Context, Poll};
55
use pin_project_lite::pin_project;
66

77
/// Type to tell [`SelectWithStrategy`] which stream to poll next.
8-
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
8+
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Hash)]
99
pub enum PollNext {
1010
/// Poll the first stream.
11+
#[default]
1112
Left,
1213
/// Poll the second stream.
1314
Right,
@@ -30,12 +31,6 @@ impl PollNext {
3031
}
3132
}
3233

33-
impl Default for PollNext {
34-
fn default() -> Self {
35-
Self::Left
36-
}
37-
}
38-
3934
enum InternalState {
4035
Start,
4136
LeftFinished,

0 commit comments

Comments
 (0)