File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,14 @@ pub fn get_command_line_settings() -> CommandLineSettings {
8686 }
8787}
8888
89- pub fn confirm ( message : impl Into < String > ) -> bool {
90- print ! ( "{} [Y/N]: " , message. into( ) ) ;
91-
89+ pub fn flush ( ) {
9290 stdout ( ) . flush ( ) . expect ( "Failed to flush stdout." ) ;
91+ }
9392
93+ pub fn confirm ( message : impl Into < String > ) -> bool {
94+ print ! ( "{} [Y/N]: " , message. into( ) ) ;
95+ flush ( ) ;
96+
9497 let mut handle = stdin ( ) . lock ( ) ;
9598 let mut ch = [ 0_u8 ] ;
9699
@@ -101,7 +104,7 @@ pub fn confirm(message: impl Into<String>) -> bool {
101104
102105pub fn input ( message : impl Into < String > ) -> String {
103106 print ! ( "{}" , message. into( ) ) ;
104- stdout ( ) . flush ( ) . expect ( "Failed to flush stdout." ) ;
107+ flush ( ) ;
105108
106109 let stdin = std:: io:: stdin ( ) ;
107110 let mut res = String :: new ( ) ;
You can’t perform that action at this time.
0 commit comments