mirror of
https://github.com/rust-lang/futures-rs.git
synced 2026-01-25 03:26:14 +00:00
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,
|
```
This commit is contained in:
@@ -5,9 +5,10 @@ use futures_core::task::{Context, Poll};
|
||||
use pin_project_lite::pin_project;
|
||||
|
||||
/// Type to tell [`SelectWithStrategy`] which stream to poll next.
|
||||
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
|
||||
#[derive(Debug, Default, PartialEq, Eq, Copy, Clone, Hash)]
|
||||
pub enum PollNext {
|
||||
/// Poll the first stream.
|
||||
#[default]
|
||||
Left,
|
||||
/// Poll the second stream.
|
||||
Right,
|
||||
@@ -30,12 +31,6 @@ impl PollNext {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for PollNext {
|
||||
fn default() -> Self {
|
||||
Self::Left
|
||||
}
|
||||
}
|
||||
|
||||
enum InternalState {
|
||||
Start,
|
||||
LeftFinished,
|
||||
|
||||
Reference in New Issue
Block a user