@@ -7,6 +7,7 @@ use crate::task::{spawn_blocking, Context, JoinHandle, Poll};
7
7
8
8
cfg_unstable ! {
9
9
use once_cell:: sync:: Lazy ;
10
+ use std:: io:: Read as _;
10
11
}
11
12
12
13
/// Constructs a new handle to the standard input of the current process.
@@ -63,9 +64,13 @@ pub struct Stdin(Mutex<State>);
63
64
///
64
65
/// [`Read`]: trait.Read.html
65
66
/// [`Stdin::lock`]: struct.Stdin.html#method.lock
67
+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
68
+ #[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
66
69
#[ derive( Debug ) ]
67
70
pub struct StdinLock < ' a > ( std:: io:: StdinLock < ' a > ) ;
68
71
72
+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
73
+ #[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
69
74
unsafe impl Send for StdinLock < ' _ > { }
70
75
71
76
/// The state of the asynchronous stdin.
@@ -257,14 +262,14 @@ cfg_windows! {
257
262
}
258
263
}
259
264
265
+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
266
+ #[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
260
267
impl Read for StdinLock < ' _ > {
261
268
fn poll_read (
262
269
mut self : Pin < & mut Self > ,
263
270
_cx : & mut Context < ' _ > ,
264
271
buf : & mut [ u8 ] ,
265
272
) -> Poll < io:: Result < usize > > {
266
- use std:: io:: Read as StdRead ;
267
-
268
273
Poll :: Ready ( self . 0 . read ( buf) )
269
274
}
270
275
}
0 commit comments