about summary refs log tree commit diff
path: root/src/libstd/sync/mpsc/spsc_queue.rs
diff options
context:
space:
mode:
authorAndre Bogus <bogusandre@gmail.com>2015-09-08 00:36:29 +0200
committerAndre Bogus <bogusandre@gmail.com>2015-09-08 00:36:29 +0200
commit9cca96545faf2cfc972cc67b83deae2a78935c43 (patch)
treeef675da82a1ce1b23173921957f6a6a167ad8db8 /src/libstd/sync/mpsc/spsc_queue.rs
parent7bf626a68045be1d1a4fac9a635113bb7775b6bb (diff)
downloadrust-9cca96545faf2cfc972cc67b83deae2a78935c43.tar.gz
rust-9cca96545faf2cfc972cc67b83deae2a78935c43.zip
some more clippy-based improvements
Diffstat (limited to 'src/libstd/sync/mpsc/spsc_queue.rs')
-rw-r--r--src/libstd/sync/mpsc/spsc_queue.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs
index 819f75c006b..ffd33f8518f 100644
--- a/src/libstd/sync/mpsc/spsc_queue.rs
+++ b/src/libstd/sync/mpsc/spsc_queue.rs
@@ -196,7 +196,7 @@ impl<T> Queue<T> {
                     let _: Box<Node<T>> = Box::from_raw(tail);
                 }
             }
-            return ret;
+            ret
         }
     }
 
@@ -207,14 +207,13 @@ impl<T> Queue<T> {
     /// The reference returned is invalid if it is not used before the consumer
     /// pops the value off the queue. If the producer then pushes another value
     /// onto the queue, it will overwrite the value pointed to by the reference.
-    pub fn peek<'a>(&'a self) -> Option<&'a mut T> {
+    pub fn peek(&self) -> Option<&mut T> {
         // This is essentially the same as above with all the popping bits
         // stripped out.
         unsafe {
             let tail = *self.tail.get();
             let next = (*tail).next.load(Ordering::Acquire);
-            if next.is_null() { return None }
-            return (*next).value.as_mut();
+            if next.is_null() { None } else { (*next).value.as_mut() }
         }
     }
 }