about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-03-22 00:20:58 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-03-22 00:35:25 +0100
commit74d68ea7ebe2085bba2758ccce366f1fa4fc6210 (patch)
tree164b41576142a0d0476b1ec3c8c325abe260c03f /src/liballoc
parent3599fd389de25af78a4616015fa937ff3aeb661a (diff)
downloadrust-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/liballoc')
-rw-r--r--src/liballoc/slice.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs
index 7b83658fca6..d8fc1faca3a 100644
--- a/src/liballoc/slice.rs
+++ b/src/liballoc/slice.rs
@@ -145,8 +145,7 @@ mod hack {
         unsafe {
             let len = b.len();
             let b = Box::into_raw(b);
-            let xs = Vec::from_raw_parts(b as *mut T, len, len);
-            xs
+            Vec::from_raw_parts(b as *mut T, len, len)
         }
     }