File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,29 @@ impl Read for Stdin {
445445 }
446446}
447447
448+ #[ stable( feature = "rust1" , since = "1.0.0" ) ]
449+ impl Read for & Stdin {
450+ fn read ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < usize > {
451+ self . lock ( ) . read ( buf)
452+ }
453+ fn read_vectored ( & mut self , bufs : & mut [ IoSliceMut < ' _ > ] ) -> io:: Result < usize > {
454+ self . lock ( ) . read_vectored ( bufs)
455+ }
456+ #[ inline]
457+ fn is_read_vectored ( & self ) -> bool {
458+ self . lock ( ) . is_read_vectored ( )
459+ }
460+ fn read_to_end ( & mut self , buf : & mut Vec < u8 > ) -> io:: Result < usize > {
461+ self . lock ( ) . read_to_end ( buf)
462+ }
463+ fn read_to_string ( & mut self , buf : & mut String ) -> io:: Result < usize > {
464+ self . lock ( ) . read_to_string ( buf)
465+ }
466+ fn read_exact ( & mut self , buf : & mut [ u8 ] ) -> io:: Result < ( ) > {
467+ self . lock ( ) . read_exact ( buf)
468+ }
469+ }
470+
448471// only used by platform-dependent io::copy specializations, i.e. unused on some platforms
449472#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
450473impl StdinLock < ' _ > {
You can’t perform that action at this time.
0 commit comments