File tree Expand file tree Collapse file tree 1 file changed +6
-20
lines changed
Expand file tree Collapse file tree 1 file changed +6
-20
lines changed Original file line number Diff line number Diff line change @@ -231,20 +231,14 @@ fn rustc_minor_nightly() -> (u32, bool) {
231231}
232232
233233fn which_freebsd ( ) -> Option < i32 > {
234- let output = std:: process:: Command :: new ( "freebsd-version" ) . output ( ) . ok ( ) ;
235- if output. is_none ( ) {
236- return None ;
237- }
238- let output = output. unwrap ( ) ;
234+ let output = std:: process:: Command :: new ( "freebsd-version" )
235+ . output ( )
236+ . ok ( ) ?;
239237 if !output. status . success ( ) {
240238 return None ;
241239 }
242240
243- let stdout = String :: from_utf8 ( output. stdout ) . ok ( ) ;
244- if stdout. is_none ( ) {
245- return None ;
246- }
247- let stdout = stdout. unwrap ( ) ;
241+ let stdout = String :: from_utf8 ( output. stdout ) . ok ( ) ?;
248242
249243 match & stdout {
250244 s if s. starts_with ( "10" ) => Some ( 10 ) ,
@@ -260,20 +254,12 @@ fn emcc_version_code() -> Option<u64> {
260254 let output = std:: process:: Command :: new ( "emcc" )
261255 . arg ( "-dumpversion" )
262256 . output ( )
263- . ok ( ) ;
264- if output. is_none ( ) {
265- return None ;
266- }
267- let output = output. unwrap ( ) ;
257+ . ok ( ) ?;
268258 if !output. status . success ( ) {
269259 return None ;
270260 }
271261
272- let stdout = String :: from_utf8 ( output. stdout ) . ok ( ) ;
273- if stdout. is_none ( ) {
274- return None ;
275- }
276- let version = stdout. unwrap ( ) ;
262+ let version = String :: from_utf8 ( output. stdout ) . ok ( ) ?;
277263
278264 // Some Emscripten versions come with `-git` attached, so split the
279265 // version string also on the `-` char.
You can’t perform that action at this time.
0 commit comments