diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2020-03-22 00:20:58 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2020-03-22 00:35:25 +0100 |
| commit | 74d68ea7ebe2085bba2758ccce366f1fa4fc6210 (patch) | |
| tree | 164b41576142a0d0476b1ec3c8c325abe260c03f /src/librustc_metadata | |
| parent | 3599fd389de25af78a4616015fa937ff3aeb661a (diff) | |
| download | rust-74d68ea7ebe2085bba2758ccce366f1fa4fc6210.tar.gz rust-74d68ea7ebe2085bba2758ccce366f1fa4fc6210.zip | |
don't create variable bindings just to return the bound value immediately (clippy::let_and_return)
Diffstat (limited to 'src/librustc_metadata')
| -rw-r--r-- | src/librustc_metadata/dynamic_lib.rs | 6 |
1 files changed, 2 insertions, 4 deletions
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 + } } } |
