@@ -48,7 +48,7 @@ extern crate futures;
48
48
extern crate mio;
49
49
extern crate nix;
50
50
#[ cfg( feature = "use_tokio" ) ]
51
- extern crate pin_utils ;
51
+ extern crate pin_project_lite ;
52
52
#[ cfg( feature = "use_tokio" ) ]
53
53
extern crate tokio;
54
54
@@ -73,7 +73,7 @@ use mio::{Evented, Ready};
73
73
use nix:: sys:: epoll:: * ;
74
74
use nix:: unistd:: close;
75
75
#[ cfg( feature = "use_tokio" ) ]
76
- use pin_utils :: unsafe_pinned ;
76
+ use pin_project_lite :: pin_project ;
77
77
#[ cfg( feature = "use_tokio" ) ]
78
78
use tokio:: io:: PollEvented ;
79
79
@@ -683,12 +683,16 @@ impl Stream for PinStream {
683
683
}
684
684
685
685
#[ cfg( feature = "use_tokio" ) ]
686
- pub struct PinValueStream { inner : PinStream }
686
+ pin_project ! {
687
+ pub struct PinValueStream {
688
+ #[ pin]
689
+ inner: PinStream
690
+ }
691
+ }
687
692
688
693
#[ cfg( feature = "use_tokio" ) ]
689
694
impl PinValueStream {
690
- unsafe_pinned ! ( inner: PinStream ) ;
691
-
695
+
692
696
fn new ( inner : PinStream ) -> Self {
693
697
PinValueStream { inner }
694
698
}
@@ -704,7 +708,7 @@ impl Stream for PinValueStream {
704
708
type Item = Result < u8 > ;
705
709
706
710
fn poll_next ( mut self : SPin < & mut Self > , cx : & mut Context ) -> Poll < Option < Self :: Item > > {
707
- match self . as_mut ( ) . inner ( ) . poll_next ( cx) {
711
+ match self . as_mut ( ) . project ( ) . inner . poll_next ( cx) {
708
712
Poll :: Ready ( Some ( res) ) => {
709
713
match res {
710
714
Ok ( _) => {
0 commit comments