From f2c2ad06caa0b05c4c8a9b3b88741afe5ab9f836 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Mon, 2 Aug 2021 12:42:06 +0200 Subject: [PATCH] Use lifetime to ensure only a single future is created at a time --- embassy/src/util/mpsc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embassy/src/util/mpsc.rs b/embassy/src/util/mpsc.rs index 4c6e8a6f..4a934eb2 100644 --- a/embassy/src/util/mpsc.rs +++ b/embassy/src/util/mpsc.rs @@ -156,7 +156,7 @@ where /// closed by `recv` until they are all consumed. /// /// [`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 { channel_cell: self.channel_cell, }