File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
library/std/src/sys/unix/process Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -648,19 +648,19 @@ impl ExitStatus {
648648 }
649649
650650 pub fn code ( & self ) -> Option < i32 > {
651- if self . exited ( ) { Some ( libc:: WEXITSTATUS ( self . 0 ) ) } else { None }
651+ self . exited ( ) . then ( || libc:: WEXITSTATUS ( self . 0 ) )
652652 }
653653
654654 pub fn signal ( & self ) -> Option < i32 > {
655- if libc:: WIFSIGNALED ( self . 0 ) { Some ( libc:: WTERMSIG ( self . 0 ) ) } else { None }
655+ libc:: WIFSIGNALED ( self . 0 ) . then ( || libc:: WTERMSIG ( self . 0 ) )
656656 }
657657
658658 pub fn core_dumped ( & self ) -> bool {
659659 libc:: WIFSIGNALED ( self . 0 ) && libc:: WCOREDUMP ( self . 0 )
660660 }
661661
662662 pub fn stopped_signal ( & self ) -> Option < i32 > {
663- if libc:: WIFSTOPPED ( self . 0 ) { Some ( libc:: WSTOPSIG ( self . 0 ) ) } else { None }
663+ libc:: WIFSTOPPED ( self . 0 ) . then ( || libc:: WSTOPSIG ( self . 0 ) )
664664 }
665665
666666 pub fn continued ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments