File tree 1 file changed +6
-20
lines changed
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) {
231
231
}
232
232
233
233
fn 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 ( ) ?;
239
237
if !output. status . success ( ) {
240
238
return None ;
241
239
}
242
240
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 ( ) ?;
248
242
249
243
match & stdout {
250
244
s if s. starts_with ( "10" ) => Some ( 10 ) ,
@@ -260,20 +254,12 @@ fn emcc_version_code() -> Option<u64> {
260
254
let output = std:: process:: Command :: new ( "emcc" )
261
255
. arg ( "-dumpversion" )
262
256
. output ( )
263
- . ok ( ) ;
264
- if output. is_none ( ) {
265
- return None ;
266
- }
267
- let output = output. unwrap ( ) ;
257
+ . ok ( ) ?;
268
258
if !output. status . success ( ) {
269
259
return None ;
270
260
}
271
261
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 ( ) ?;
277
263
278
264
// Some Emscripten versions come with `-git` attached, so split the
279
265
// version string also on the `-` char.
You can’t perform that action at this time.
0 commit comments