File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -108,10 +108,27 @@ macro_rules! impl_from_for_stdio {
108
108
}
109
109
}
110
110
} ;
111
+ ( deprecated $type: ty) => {
112
+ #[ allow( useless_deprecated) ]
113
+ #[ deprecated(
114
+ since = "0.9.8" ,
115
+ note = "Use From<OwnedFd> for Stdio or Stdio::from_raw_fd_owned instead"
116
+ ) ]
117
+ /// deprecated, use `From<OwnedFd> for Stdio` or
118
+ /// [`Stdio::from_raw_fd_owned`] instead.
119
+ impl From <$type> for Stdio {
120
+ fn from( arg: $type) -> Self {
121
+ let fd = arg. into_raw_fd( ) ;
122
+ // safety: $type must have a valid into_raw_fd implementation
123
+ // and must not be RawFd.
124
+ Self ( StdioImpl :: Fd ( unsafe { OwnedFd :: from_raw_fd( fd) } , true ) )
125
+ }
126
+ }
127
+ } ;
111
128
}
112
129
113
- impl_from_for_stdio ! ( tokio_pipe:: PipeWrite ) ;
114
- impl_from_for_stdio ! ( tokio_pipe:: PipeRead ) ;
130
+ impl_from_for_stdio ! ( deprecated tokio_pipe:: PipeWrite ) ;
131
+ impl_from_for_stdio ! ( deprecated tokio_pipe:: PipeRead ) ;
115
132
116
133
impl_from_for_stdio ! ( process:: ChildStdin ) ;
117
134
impl_from_for_stdio ! ( process:: ChildStdout ) ;
You can’t perform that action at this time.
0 commit comments