|
1 | 1 | use super::assert_stream; |
2 | 2 | use crate::stream::{Fuse, StreamExt}; |
3 | | -use core::pin::Pin; |
| 3 | +use core::{fmt, pin::Pin}; |
4 | 4 | use futures_core::stream::{FusedStream, Stream}; |
5 | 5 | use futures_core::task::{Context, Poll}; |
6 | 6 | use pin_project_lite::pin_project; |
@@ -36,7 +36,6 @@ impl Default for PollNext { |
36 | 36 |
|
37 | 37 | pin_project! { |
38 | 38 | /// Stream for the [`select_with_strategy()`] function. See function docs for details. |
39 | | - #[derive(Debug)] |
40 | 39 | #[must_use = "streams do nothing unless polled"] |
41 | 40 | pub struct SelectWithStrategy<St1, St2, Clos, State> { |
42 | 41 | #[pin] |
@@ -214,3 +213,18 @@ where |
214 | 213 | Poll::Ready(None) | Poll::Pending => Poll::Pending, |
215 | 214 | } |
216 | 215 | } |
| 216 | + |
| 217 | +impl<St1, St2, Clos, State> fmt::Debug for SelectWithStrategy<St1, St2, Clos, State> |
| 218 | +where |
| 219 | + St1: fmt::Debug, |
| 220 | + St2: fmt::Debug, |
| 221 | + State: std::fmt::Debug, |
| 222 | +{ |
| 223 | + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 224 | + f.debug_struct("SelectWithStrategy") |
| 225 | + .field("stream1", &self.stream1) |
| 226 | + .field("stream2", &self.stream2) |
| 227 | + .field("state", &self.state) |
| 228 | + .finish() |
| 229 | + } |
| 230 | +} |
0 commit comments