]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_session/src/filesearch.rs
Make stage2 rustdoc and proc-macro-srv disableable in x.py install
[rust.git] / compiler / rustc_session / src / filesearch.rs
index 1855a49c1ecdf36b331a92e362feaa3f54eec1d5..6f1b31ff9c3aec9cbce8cb0bf3b2fe053a566ba7 100644 (file)
@@ -122,7 +122,7 @@ fn current_dll_path() -> Result<PathBuf, String> {
     let target = crate::config::host_triple();
     let mut sysroot_candidates: SmallVec<[PathBuf; 2]> =
         smallvec![get_or_default_sysroot().expect("Failed finding sysroot")];
-    let path = current_dll_path().and_then(|s| Ok(s.canonicalize().map_err(|e| e.to_string())?));
+    let path = current_dll_path().and_then(|s| s.canonicalize().map_err(|e| e.to_string()));
     if let Ok(dll) = path {
         // use `parent` twice to chop off the file name and then also the
         // directory containing the dll which should be either `lib` or `bin`.
@@ -165,7 +165,7 @@ fn canonicalize(path: PathBuf) -> PathBuf {
     }
 
     fn default_from_rustc_driver_dll() -> Result<PathBuf, String> {
-        let dll = current_dll_path().and_then(|s| Ok(canonicalize(s)))?;
+        let dll = current_dll_path().map(|s| canonicalize(s))?;
 
         // `dll` will be in one of the following two:
         // - compiler's libdir: $sysroot/lib/*.dll