From 74d68ea7ebe2085bba2758ccce366f1fa4fc6210 Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Sun, 22 Mar 2020 00:20:58 +0100 Subject: don't create variable bindings just to return the bound value immediately (clippy::let_and_return) --- src/librustc_metadata/dynamic_lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/librustc_metadata') diff --git a/src/librustc_metadata/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs index f04d0239d49..3e78a585235 100644 --- a/src/librustc_metadata/dynamic_lib.rs +++ b/src/librustc_metadata/dynamic_lib.rs @@ -94,14 +94,12 @@ mod dl { let result = f(); let last_error = libc::dlerror() as *const _; - let ret = if ptr::null() == last_error { + if ptr::null() == last_error { Ok(result) } else { let s = CStr::from_ptr(last_error).to_bytes(); Err(str::from_utf8(s).unwrap().to_owned()) - }; - - ret + } } } -- cgit 1.4.1-3-g733a5