aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-24 07:31:56 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-24 07:31:56 -0400
commitc3dc91b606dc556de5b1999aa90f2b9ba59b4f54 (patch)
tree1894b339c31d4ea69b5263951fc0090c90f8c0e8
parentec954d2ce33de2fc59544cb9824b34c28d72dace (diff)
downloadcomponent-future-c3dc91b606dc556de5b1999aa90f2b9ba59b4f54.tar.gz
component-future-c3dc91b606dc556de5b1999aa90f2b9ba59b4f54.zip
don't require the lifetimes to be 'static
-rw-r--r--src/lib.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/lib.rs b/src/lib.rs
index e3ee46a..df145e9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -188,11 +188,9 @@ macro_rules! try_ready {
/// }
/// }
/// ```
-pub fn poll_future<T, Item, Error>(
+pub fn poll_future<'a, T, Item, Error>(
future: &mut T,
- poll_fns: &'static [&'static dyn for<'a> Fn(
- &'a mut T,
- ) -> Poll<Item, Error>],
+ poll_fns: &'a [&'a dyn for<'b> Fn(&'b mut T) -> Poll<Item, Error>],
) -> futures::Poll<Item, Error>
where
T: futures::future::Future<Item = Item, Error = Error>,
@@ -250,14 +248,11 @@ where
/// }
/// }
/// ```
-pub fn poll_stream<T, Item, Error>(
+pub fn poll_stream<'a, T, Item, Error>(
stream: &mut T,
- poll_fns: &'static [&'static dyn for<'a> Fn(
- &'a mut T,
- ) -> Poll<
- Option<Item>,
- Error,
- >],
+ poll_fns: &'a [&'a dyn for<'b> Fn(
+ &'b mut T,
+ ) -> Poll<Option<Item>, Error>],
) -> futures::Poll<Option<Item>, Error>
where
T: futures::stream::Stream<Item = Item, Error = Error>,