diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-10-24 07:31:56 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-10-24 07:31:56 -0400 |
commit | c3dc91b606dc556de5b1999aa90f2b9ba59b4f54 (patch) | |
tree | 1894b339c31d4ea69b5263951fc0090c90f8c0e8 | |
parent | ec954d2ce33de2fc59544cb9824b34c28d72dace (diff) | |
download | component-future-c3dc91b606dc556de5b1999aa90f2b9ba59b4f54.tar.gz component-future-c3dc91b606dc556de5b1999aa90f2b9ba59b4f54.zip |
don't require the lifetimes to be 'static
-rw-r--r-- | src/lib.rs | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -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>, |