File tree 1 file changed +3
-18
lines changed
1 file changed +3
-18
lines changed Original file line number Diff line number Diff line change 1
- use cfg_if:: cfg_if;
2
-
3
1
use crate :: stream:: { FromStream , IntoStream , Stream } ;
4
2
5
3
use std:: pin:: Pin ;
6
4
7
- cfg_if ! {
8
- if #[ cfg( feature = "docs" ) ] {
9
- #[ doc( hidden) ]
10
- pub struct DynFuture <' a, T >( std:: marker:: PhantomData <& ' a T >) ;
11
-
12
- macro_rules! dyn_ret {
13
- ( $a: lifetime, $o: ty) => ( DynFuture <$a, $o>) ;
14
- }
15
- } else {
16
- macro_rules! dyn_ret {
17
- ( $a: lifetime, $o: ty) => ( Pin <Box <dyn core:: future:: Future <Output = $o> + Send + ' a>>)
18
- }
19
- }
20
- }
21
-
22
5
impl < T : Unpin + Sized + Send > FromStream < T > for Vec < T > {
23
6
#[ inline]
24
- fn from_stream < ' a , S : IntoStream < Item = T > > ( stream : S ) -> dyn_ret ! ( ' a, Self )
7
+ fn from_stream < ' a , S : IntoStream < Item = T > > (
8
+ stream : S ,
9
+ ) -> Pin < Box < dyn core:: future:: Future < Output = Self > + Send + ' a > >
25
10
where
26
11
<S as IntoStream >:: IntoStream : Send + ' a ,
27
12
{
You can’t perform that action at this time.
0 commit comments