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 @@ -233,20 +233,14 @@ fn rustc_minor_nightly() -> (u32, bool) {
233
233
}
234
234
235
235
fn which_freebsd ( ) -> Option < i32 > {
236
- let output = std:: process:: Command :: new ( "freebsd-version" ) . output ( ) . ok ( ) ;
237
- if output. is_none ( ) {
238
- return None ;
239
- }
240
- let output = output. unwrap ( ) ;
236
+ let output = std:: process:: Command :: new ( "freebsd-version" )
237
+ . output ( )
238
+ . ok ( ) ?;
241
239
if !output. status . success ( ) {
242
240
return None ;
243
241
}
244
242
245
- let stdout = String :: from_utf8 ( output. stdout ) . ok ( ) ;
246
- if stdout. is_none ( ) {
247
- return None ;
248
- }
249
- let stdout = stdout. unwrap ( ) ;
243
+ let stdout = String :: from_utf8 ( output. stdout ) . ok ( ) ?;
250
244
251
245
match & stdout {
252
246
s if s. starts_with ( "10" ) => Some ( 10 ) ,
@@ -263,20 +257,12 @@ fn emcc_version_code() -> Option<u64> {
263
257
let output = std:: process:: Command :: new ( "emcc" )
264
258
. arg ( "-dumpversion" )
265
259
. output ( )
266
- . ok ( ) ;
267
- if output. is_none ( ) {
268
- return None ;
269
- }
270
- let output = output. unwrap ( ) ;
260
+ . ok ( ) ?;
271
261
if !output. status . success ( ) {
272
262
return None ;
273
263
}
274
264
275
- let stdout = String :: from_utf8 ( output. stdout ) . ok ( ) ;
276
- if stdout. is_none ( ) {
277
- return None ;
278
- }
279
- let version = stdout. unwrap ( ) ;
265
+ let version = String :: from_utf8 ( output. stdout ) . ok ( ) ?;
280
266
281
267
// Some Emscripten versions come with `-git` attached, so split the
282
268
// version string also on the `-` char.
You can’t perform that action at this time.
0 commit comments