aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-09-09 18:20:00 -0400
committerBrian Cully <bjc@kublai.com>2019-09-09 18:20:00 -0400
commit8ee3e7b59c3531b9a79758d29ef9fde8c4790e58 (patch)
treef8b1ce1ea09f29b425475ba6edc575bc0c129ba9
parente75ed40e73586479334649dc17f46a7fd8409756 (diff)
downloadstarb-8ee3e7b59c3531b9a79758d29ef9fde8c4790e58.tar.gz
starb-8ee3e7b59c3531b9a79758d29ef9fde8c4790e58.zip
Fix clippy lints.
-rw-r--r--src/lib.rs5
1 files 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<T> RingBuffer<T> {
//
// 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<T>, Writer<T>) {
+ pub const fn split(&self) -> (Reader<T>, Writer<T>) {
let rbr = Reader { rb: &self };
let rbw = Writer { rb: &self };
(rbr, rbw)
@@ -92,8 +92,7 @@ impl<T> 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.