about summary refs log tree commit diff
path: root/compiler/rustc_driver/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-24 00:17:35 +0000
committerbors <bors@rust-lang.org>2022-11-24 00:17:35 +0000
commit872631d0f0fadffe3220ab1bd9c8f1f2342341e2 (patch)
tree6721d534b4d7f5b0e7c364c451ffb6b792bfdea7 /compiler/rustc_driver/src/lib.rs
parent70f8737b2f5d3bf7d6b784fad00b663b7ff9feda (diff)
parent94470f4efd2ec0786dd1f201e9ea84651b4bb0d0 (diff)
downloadrust-872631d0f0fadffe3220ab1bd9c8f1f2342341e2.tar.gz
rust-872631d0f0fadffe3220ab1bd9c8f1f2342341e2.zip
Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiser
Use `as_deref` in compiler (but only where it makes sense)

This simplifies some code :3

(there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
Diffstat (limited to 'compiler/rustc_driver/src/lib.rs')
-rw-r--r--compiler/rustc_driver/src/lib.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs
index 8a712cec852..8e176efb2a9 100644
--- a/compiler/rustc_driver/src/lib.rs
+++ b/compiler/rustc_driver/src/lib.rs
@@ -318,7 +318,7 @@ fn run_compiler(
                             compiler.input(),
                             &*expanded_crate,
                             *ppm,
-                            compiler.output_file().as_ref().map(|p| &**p),
+                            compiler.output_file().as_deref(),
                         );
                         Ok(())
                     })?;
@@ -329,7 +329,7 @@ fn run_compiler(
                         compiler.input(),
                         &krate,
                         *ppm,
-                        compiler.output_file().as_ref().map(|p| &**p),
+                        compiler.output_file().as_deref(),
                     );
                 }
                 trace!("finished pretty-printing");
@@ -383,10 +383,7 @@ fn run_compiler(
                             &crate_name,
                             compiler.input(),
                             None,
-                            DumpHandler::new(
-                                compiler.output_dir().as_ref().map(|p| &**p),
-                                &crate_name,
-                            ),
+                            DumpHandler::new(compiler.output_dir().as_deref(), &crate_name),
                         )
                     });
                 }