1313
1414mod  tty; 
1515
16+ #[ cfg( target_family = "windows" ) ]  
17+ mod  win32; 
18+ 
1619pub  use  crate :: tty:: Stream ; 
1720use  std:: error:: Error ; 
1821use  std:: io:: Read ; 
@@ -186,14 +189,15 @@ fn find_lf(input: &[u8]) -> Option<usize> {
186189#[ cfg( target_family = "windows" ) ]  
187190mod  windows { 
188191    use  crate :: { find_crlf,  print_stream,  strip_newline,  PromptError ,  Stream } ; 
189- 
190-     use  windows_sys:: Win32 :: Foundation :: { 
191-         CloseHandle ,  BOOL ,  FALSE ,  GENERIC_READ ,  GENERIC_WRITE ,  HANDLE ,  INVALID_HANDLE_VALUE , 
192+     use  crate :: win32:: { 
193+         CreateFileA ,  GetFileType ,  CloseHandle , 
194+         GetConsoleMode ,  GetStdHandle ,  ReadConsoleW , 
195+         SetConsoleMode ,  WriteConsoleW 
192196    } ; 
193-     use  windows_sys :: Win32 :: Storage :: FileSystem :: { CreateFileA ,   GetFileType ,   OPEN_EXISTING } ; 
194-     use  windows_sys :: Win32 :: System :: Console :: { 
195-         GetConsoleMode ,   GetStdHandle ,   ReadConsoleW ,   SetConsoleMode ,   WriteConsoleW ,   CONSOLE_MODE , 
196-         ENABLE_ECHO_INPUT ,  STD_INPUT_HANDLE , 
197+     use  crate :: win32 :: { 
198+          HANDLE ,   BOOL ,   FALSE ,   OPEN_EXISTING , 
199+         GENERIC_READ ,   GENERIC_WRITE ,   INVALID_HANDLE_VALUE , 
200+         ENABLE_ECHO_INPUT ,  STD_INPUT_HANDLE 
197201    } ; 
198202
199203    struct  HandleCloser ( HANDLE ) ; 
@@ -205,9 +209,9 @@ mod windows {
205209    } 
206210
207211    fn  set_echo ( echo :  bool ,  handle :  HANDLE )  -> Result < ( ) ,  PromptError >  { 
208-         let  mut  mode:  CONSOLE_MODE  = 0 ; 
212+         let  mut  mode:  u32  = 0 ; 
209213        unsafe  { 
210-             if  GetConsoleMode ( handle,  & mut  mode  as   * mut   CONSOLE_MODE )  == FALSE  { 
214+             if  GetConsoleMode ( handle,  & mut  mode)  == FALSE  { 
211215                return  Err ( PromptError :: IOError ( std:: io:: Error :: last_os_error ( ) ) ) ; 
212216            } 
213217        } 
@@ -272,7 +276,7 @@ mod windows {
272276            // the file type comes back as FILE_TYPE_PIPE 0x03. This means 
273277            // that we can't tell if we're in a pipe or a console, so echo 
274278            // won't be disabled at all. 
275-             GetFileType ( handle)  == windows_sys :: Win32 :: Storage :: FileSystem :: FILE_TYPE_CHAR 
279+             GetFileType ( handle)  == crate :: win32 :: FILE_TYPE_CHAR 
276280        } ; 
277281
278282        // Disable terminal echo if we're in a console, if we're not, 
0 commit comments