File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -404,7 +404,7 @@ fn stty(opts: &Options) -> UResult<()> {
404404 }
405405
406406 // TODO: Figure out the right error message for when tcgetattr fails
407- let mut termios = tcgetattr ( opts. file . as_fd ( ) ) . expect ( "Could not get terminal attributes" ) ;
407+ let mut termios = tcgetattr ( opts. file . as_fd ( ) ) ? ;
408408
409409 // iterate over valid_args, match on the arg type, do the matching apply function
410410 for arg in & valid_args {
@@ -419,12 +419,11 @@ fn stty(opts: &Options) -> UResult<()> {
419419 }
420420 }
421421 }
422- tcsetattr ( opts. file . as_fd ( ) , set_arg, & termios)
423- . expect ( "Could not write terminal attributes" ) ;
422+ tcsetattr ( opts. file . as_fd ( ) , set_arg, & termios) ?;
424423 } else {
425424 // TODO: Figure out the right error message for when tcgetattr fails
426- let termios = tcgetattr ( opts. file . as_fd ( ) ) . expect ( "Could not get terminal attributes" ) ;
427- print_settings ( & termios, opts) . expect ( "TODO: make proper error here from nix error" ) ;
425+ let termios = tcgetattr ( opts. file . as_fd ( ) ) ? ;
426+ print_settings ( & termios, opts) ? ;
428427 }
429428 Ok ( ( ) )
430429}
You can’t perform that action at this time.
0 commit comments