util: add lifetime parameter to ReusableBoxFuture (#3762)

Co-authored-by: Toby Lawrence <[email protected]>
This commit is contained in:
Kestrer
2022-02-09 14:29:21 -05:00
committed by GitHub
co-authored by Toby Lawrence
parent 52fb93dce9
commit 9c688ecdc3
5 changed files with 21 additions and 24 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ use std::task::{Context, Poll};
/// [`Stream`]: trait@crate::Stream
#[cfg_attr(docsrs, doc(cfg(feature = "sync")))]
pub struct BroadcastStream<T> {
inner: ReusableBoxFuture<(Result<T, RecvError>, Receiver<T>)>,
inner: ReusableBoxFuture<'static, (Result<T, RecvError>, Receiver<T>)>,
}
/// An error returned from the inner stream of a [`BroadcastStream`].
+1 -1
View File
@@ -49,7 +49,7 @@ use tokio::sync::watch::error::RecvError;
/// [`Stream`]: trait@crate::Stream
#[cfg_attr(docsrs, doc(cfg(feature = "sync")))]
pub struct WatchStream<T> {
inner: ReusableBoxFuture<(Result<(), RecvError>, Receiver<T>)>,
inner: ReusableBoxFuture<'static, (Result<(), RecvError>, Receiver<T>)>,
}
async fn make_future<T: Clone + Send + Sync>(