File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -344,11 +344,11 @@ impl TestDriver {
344
344
. iter ( )
345
345
. map ( |f| format ! ( "--features={f}" ) ) ,
346
346
)
347
- . args ( if test_run . cpu_lock_by_basepri {
348
- Some ( "--features=cpu-lock-by-basepri" )
349
- } else {
350
- None
351
- } )
347
+ . args (
348
+ test_run
349
+ . cpu_lock_by_basepri
350
+ . then_some ( "--features=cpu-lock-by-basepri" ) ,
351
+ )
352
352
. arg ( match log_level {
353
353
LogLevel :: Off => "--features=log/max_level_off" ,
354
354
LogLevel :: Error => "--features=log/max_level_error" ,
@@ -357,8 +357,7 @@ impl TestDriver {
357
357
LogLevel :: Debug => "--features=log/max_level_debug" ,
358
358
LogLevel :: Trace => "--features=log/max_level_trace" ,
359
359
} )
360
- . args ( if verbose { None } else { Some ( "-q" ) } )
361
- // TODO: Use `bool::then` in other places
360
+ . args ( ( !verbose) . then_some ( "-q" ) )
362
361
. args ( build_std. then_some ( "-Zbuild-std=core" ) )
363
362
. args ( small_rt. then_some ( "-Zbuild-std-features=panic_immediate_abort" ) )
364
363
. env ( "R3_TEST_DRIVER_LINK_SEARCH" , link_dir. path ( ) )
Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ impl Arch {
473
473
d : true ,
474
474
} => Some ( BuildOpt :: from_target_triple ( "riscv64gc-unknown-none-elf" ) ) ,
475
475
476
- Self :: Riscv {
476
+ & Self :: Riscv {
477
477
xlen,
478
478
e,
479
479
m,
@@ -487,12 +487,12 @@ impl Arch {
487
487
Xlen :: _64 => "riscv64imac-unknown-none-elf" ,
488
488
} )
489
489
. with_target_features ( & [
490
- if * e { Some ( "+e" ) } else { None } ,
491
- if * m { None } else { Some ( "-m" ) } ,
492
- if * a { None } else { Some ( "-a" ) } ,
493
- if * c { None } else { Some ( "-c" ) } ,
494
- if * f { Some ( "+f" ) } else { None } ,
495
- if * d { Some ( "+d" ) } else { None } ,
490
+ e . then_some ( "+e" ) ,
491
+ ( !m ) . then_some ( "-m" ) ,
492
+ ( !a ) . then_some ( "-a" ) ,
493
+ ( !c ) . then_some ( "-c" ) ,
494
+ f . then_some ( "+f" ) ,
495
+ d . then_some ( "+d" ) ,
496
496
] ) ,
497
497
) ,
498
498
}
You can’t perform that action at this time.
0 commit comments