diff --git a/yamux/src/connection.rs b/yamux/src/connection.rs index 36708675..bd2b1f69 100644 --- a/yamux/src/connection.rs +++ b/yamux/src/connection.rs @@ -350,8 +350,7 @@ struct Active { streams: IntMap, stream_sender: mpsc::Sender, stream_receiver: mpsc::Receiver, - garbage: Vec, - // see `Connection::garbage_collect()` + dropped_streams: Vec, pending_frames: VecDeque>, } @@ -423,7 +422,7 @@ impl Active { Mode::Client => 1, Mode::Server => 2, }, - garbage: Vec::new(), + dropped_streams: Vec::new(), pending_frames: VecDeque::default(), } } @@ -912,9 +911,9 @@ impl Active { log::trace!("{}/{}: sending: {}", self.id, stream_id, f.header()); self.pending_frames.push_back(f.into()); } - self.garbage.push(stream_id) + self.dropped_streams.push(stream_id) } - for id in self.garbage.drain(..) { + for id in self.dropped_streams.drain(..) { self.streams.remove(&id); } }