Skip to content

Commit 31d58a8

Browse files
committed
Don't crash on I/O errors
This does mean an I/O error is now considered a negative response (since exit code 1 will be returned). I think that's ok. Signed-off-by: Alex Saveau <[email protected]>
1 parent 2c0b481 commit 31d58a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ fn main() -> impl Termination {
1212

1313
let mut stdin = ManuallyDrop::new(unsafe { File::from_raw_fd(0) });
1414
let mut stdout = ManuallyDrop::new(unsafe { File::from_raw_fd(1) });
15-
ask(question, &mut *stdin, &mut *stdout).unwrap()
15+
ask(question, &mut *stdin, &mut *stdout)
1616
}
1717
#[cfg(not(unix))]
1818
{
1919
use std::io;
2020

2121
let mut stdin = io::stdin().lock();
2222
let mut stdout = io::stdout().lock();
23-
ask(&question, &mut stdin, &mut stdout).unwrap()
23+
ask(&question, &mut stdin, &mut stdout)
2424
}
2525
}
2626

0 commit comments

Comments
 (0)