Use lifetime to ensure only a single future is created at a time

This commit is contained in:
Ulf Lilleengen 2021-08-02 12:42:06 +02:00
parent 4d8d8e386f
commit f2c2ad06ca

View File

@ -156,7 +156,7 @@ where
/// closed by `recv` until they are all consumed. /// closed by `recv` until they are all consumed.
/// ///
/// [`close`]: Self::close /// [`close`]: Self::close
pub fn recv(&mut self) -> RecvFuture<'ch, M, T, N> { pub fn recv<'m>(&'m mut self) -> RecvFuture<'m, M, T, N> {
RecvFuture { RecvFuture {
channel_cell: self.channel_cell, channel_cell: self.channel_cell,
} }