File tree 1 file changed +3
-3
lines changed
library/std/src/sys/unix/process
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -648,19 +648,19 @@ impl ExitStatus {
648
648
}
649
649
650
650
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 ) )
652
652
}
653
653
654
654
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 ) )
656
656
}
657
657
658
658
pub fn core_dumped ( & self ) -> bool {
659
659
libc:: WIFSIGNALED ( self . 0 ) && libc:: WCOREDUMP ( self . 0 )
660
660
}
661
661
662
662
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 ) )
664
664
}
665
665
666
666
pub fn continued ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments