diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2022-05-13 12:20:32 +0000 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2022-06-06 12:38:38 +0000 |
| commit | 906b85157cc7928d86fd186a255f3fd89543aca8 (patch) | |
| tree | 1fb4112c7cca2c3dd0cb9db943ae57c8f95b0bb3 /compiler/rustc_codegen_ssa | |
| parent | 065e202b563b7f690b7cc79b8fb5a61150c2976e (diff) | |
| download | rust-906b85157cc7928d86fd186a255f3fd89543aca8.tar.gz rust-906b85157cc7928d86fd186a255f3fd89543aca8.zip | |
Factor Option out of copy_cgu_workproduct_to_incr_comp_cache_dir call
This improves clarity of the code a bit
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/write.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index 7cd062e5e4b..36e59066524 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -494,12 +494,12 @@ fn copy_all_cgu_workproducts_to_incr_comp_cache_dir( let _timer = sess.timer("copy_all_cgu_workproducts_to_incr_comp_cache_dir"); for module in compiled_modules.modules.iter().filter(|m| m.kind == ModuleKind::Regular) { - let path = module.object.as_deref(); - - if let Some((id, product)) = - copy_cgu_workproduct_to_incr_comp_cache_dir(sess, &module.name, path) - { - work_products.insert(id, product); + if let Some(path) = &module.object { + if let Some((id, product)) = + copy_cgu_workproduct_to_incr_comp_cache_dir(sess, &module.name, path) + { + work_products.insert(id, product); + } } } |
