Skip to content

Commit f58bd0e

Browse files
committed
if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r)
1 parent 9b99a58 commit f58bd0e

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/driver/aot.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,13 @@ fn reuse_workproduct_for_cgu(
248248
dwarf_object: None,
249249
bytecode: None,
250250
},
251-
module_global_asm: if has_global_asm {
252-
Some(CompiledModule {
253-
name: cgu.name().to_string(),
254-
kind: ModuleKind::Regular,
255-
object: Some(obj_out_global_asm),
256-
dwarf_object: None,
257-
bytecode: None,
258-
})
259-
} else {
260-
None
261-
},
251+
module_global_asm: has_global_asm.then(|| CompiledModule {
252+
name: cgu.name().to_string(),
253+
kind: ModuleKind::Regular,
254+
object: Some(obj_out_global_asm),
255+
dwarf_object: None,
256+
bytecode: None,
257+
}),
262258
existing_work_product: Some((cgu.work_product_id(), work_product)),
263259
})
264260
}

0 commit comments

Comments
 (0)