summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Vorotnikov <artem@vorotnikov.me>2020-11-03 11:09:05 +0300
committerGitHub <noreply@github.com>2020-11-03 09:09:05 +0100
commit06c7e73e9941ae8d7f84e978b24cb2e0664453de (patch)
treea6db5cfc6edd2f3b4b69b6eb175b3ba5e4b366a3
parent42de3bc7a44100eec06645a5bfef8be286ff0507 (diff)
stream: fix StreamMap Default bound (#3093)
-rw-r--r--tokio/src/stream/stream_map.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/tokio/src/stream/stream_map.rs b/tokio/src/stream/stream_map.rs
index 8539e4da..9fed3c19 100644
--- a/tokio/src/stream/stream_map.rs
+++ b/tokio/src/stream/stream_map.rs
@@ -156,7 +156,7 @@ use std::task::{Context, Poll};
/// }
/// }
/// ```
-#[derive(Debug, Default)]
+#[derive(Debug)]
pub struct StreamMap<K, V> {
/// Streams stored in the map
entries: Vec<(K, V)>,
@@ -513,6 +513,12 @@ where
}
}
+impl<K, V> Default for StreamMap<K, V> {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl<K, V> Stream for StreamMap<K, V>
where
K: Clone + Unpin,