From 1da4a499122f59201cf761b79f9e8c6ded1cb91d Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Sun, 18 Dec 2022 12:45:56 +0100 Subject: clippy::complexity fixes filter_next needless_question_mark bind_instead_of_map manual_find derivable_impls map_identity redundant_slicing skip_while_next unnecessary_unwrap needless_bool --- compiler/rustc_session/src/filesearch.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/rustc_session/src/filesearch.rs') diff --git a/compiler/rustc_session/src/filesearch.rs b/compiler/rustc_session/src/filesearch.rs index 1855a49c1ec..6f1b31ff9c3 100644 --- a/compiler/rustc_session/src/filesearch.rs +++ b/compiler/rustc_session/src/filesearch.rs @@ -122,7 +122,7 @@ pub fn sysroot_candidates() -> SmallVec<[PathBuf; 2]> { 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 @@ pub fn get_or_default_sysroot() -> Result { } fn default_from_rustc_driver_dll() -> Result { - 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 -- cgit 1.4.1-3-g733a5