diff options
author | Brian Cully <bjc@kublai.com> | 2019-09-09 18:20:00 -0400 |
---|---|---|
committer | Brian Cully <bjc@kublai.com> | 2019-09-09 18:20:00 -0400 |
commit | 8ee3e7b59c3531b9a79758d29ef9fde8c4790e58 (patch) | |
tree | f8b1ce1ea09f29b425475ba6edc575bc0c129ba9 | |
parent | e75ed40e73586479334649dc17f46a7fd8409756 (diff) | |
download | starb-8ee3e7b59c3531b9a79758d29ef9fde8c4790e58.tar.gz starb-8ee3e7b59c3531b9a79758d29ef9fde8c4790e58.zip |
Fix clippy lints.
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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. |