From 8ee3e7b59c3531b9a79758d29ef9fde8c4790e58 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 9 Sep 2019 18:20:00 -0400 Subject: Fix clippy lints. --- src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index edf5697..b4c1698 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,7 +60,7 @@ impl RingBuffer { // // No, lazy_static is not an option, because it doesn't work on // architectures where CAS atomics are missing. - pub const fn split<'a>(&'a self) -> (Reader, Writer) { + pub const fn split(&self) -> (Reader, Writer) { let rbr = Reader { rb: &self }; let rbw = Writer { rb: &self }; (rbr, rbw) @@ -92,8 +92,7 @@ impl Reader<'_, T> { let t = self.rb.tail.load(Ordering::Relaxed); atomic::fence(Ordering::Acquire); - let rc = (t + CAPACITY - h) % CAPACITY; - rc + (t + CAPACITY - h) % CAPACITY } /// Whether or not the ring buffer is empty. -- cgit v1.2.3