aboutsummaryrefslogtreecommitdiff
path: root/rtic-sync
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2024-12-06 13:38:15 +0100
committerEmil Fresk <emil.fresk@gmail.com>2024-12-06 14:09:26 +0100
commitb41a10e794261e1539cd571aab00fca40568ba87 (patch)
tree50f184af566d990ae3ca3c99e585ac4ae9c57632 /rtic-sync
parentf17915842ff18be48b6c8ed5faac378bc26ff3b3 (diff)
Fix documentation (docs.rs) and release 2.1.2
Diffstat (limited to 'rtic-sync')
-rw-r--r--rtic-sync/src/arbiter.rs14
-rw-r--r--rtic-sync/src/channel.rs27
-rw-r--r--rtic-sync/src/signal.rs2
3 files changed, 23 insertions, 20 deletions
diff --git a/rtic-sync/src/arbiter.rs b/rtic-sync/src/arbiter.rs
index a173e24..768e200 100644
--- a/rtic-sync/src/arbiter.rs
+++ b/rtic-sync/src/arbiter.rs
@@ -161,7 +161,7 @@ pub struct ExclusiveAccess<'a, T> {
inner: &'a mut T,
}
-impl<'a, T> Drop for ExclusiveAccess<'a, T> {
+impl<T> Drop for ExclusiveAccess<'_, T> {
fn drop(&mut self) {
critical_section::with(|_| {
fence(Ordering::SeqCst);
@@ -177,7 +177,7 @@ impl<'a, T> Drop for ExclusiveAccess<'a, T> {
}
}
-impl<'a, T> Deref for ExclusiveAccess<'a, T> {
+impl<T> Deref for ExclusiveAccess<'_, T> {
type Target = T;
fn deref(&self) -> &Self::Target {
@@ -185,7 +185,7 @@ impl<'a, T> Deref for ExclusiveAccess<'a, T> {
}
}
-impl<'a, T> DerefMut for ExclusiveAccess<'a, T> {
+impl<T> DerefMut for ExclusiveAccess<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
self.inner
}
@@ -215,7 +215,7 @@ pub mod spi {
}
}
- impl<'a, BUS, CS, D> ErrorType for ArbiterDevice<'a, BUS, CS, D>
+ impl<BUS, CS, D> ErrorType for ArbiterDevice<'_, BUS, CS, D>
where
BUS: ErrorType,
CS: OutputPin,
@@ -223,7 +223,7 @@ pub mod spi {
type Error = DeviceError<BUS::Error, CS::Error>;
}
- impl<'a, Word, BUS, CS, D> SpiDevice<Word> for ArbiterDevice<'a, BUS, CS, D>
+ impl<Word, BUS, CS, D> SpiDevice<Word> for ArbiterDevice<'_, BUS, CS, D>
where
Word: Copy + 'static,
BUS: SpiBus<Word>,
@@ -338,14 +338,14 @@ pub mod i2c {
}
}
- impl<'a, BUS> ErrorType for ArbiterDevice<'a, BUS>
+ impl<BUS> ErrorType for ArbiterDevice<'_, BUS>
where
BUS: ErrorType,
{
type Error = BUS::Error;
}
- impl<'a, BUS, A> I2c<A> for ArbiterDevice<'a, BUS>
+ impl<BUS, A> I2c<A> for ArbiterDevice<'_, BUS>
where
BUS: I2c<A>,
A: AddressMode,
diff --git a/rtic-sync/src/channel.rs b/rtic-sync/src/channel.rs
index 0857f72..65a83d9 100644
--- a/rtic-sync/src/channel.rs
+++ b/rtic-sync/src/channel.rs
@@ -127,7 +127,10 @@ macro_rules! make_channel {
// SAFETY: This is safe as we hide the static mut from others to access it.
// Only this point is where the mutable access happens.
- unsafe { CHANNEL.split() }
+ #[allow(static_mut_refs)]
+ unsafe {
+ CHANNEL.split()
+ }
}};
}
@@ -184,7 +187,7 @@ where
/// A `Sender` can send to the channel and can be cloned.
pub struct Sender<'a, T, const N: usize>(&'a Channel<T, N>);
-unsafe impl<'a, T, const N: usize> Send for Sender<'a, T, N> {}
+unsafe impl<T, const N: usize> Send for Sender<'_, T, N> {}
/// This is needed to make the async closure in `send` accept that we "share"
/// the link possible between threads.
@@ -202,20 +205,20 @@ unsafe impl Send for LinkPtr {}
unsafe impl Sync for LinkPtr {}
-impl<'a, T, const N: usize> core::fmt::Debug for Sender<'a, T, N> {
+impl<T, const N: usize> core::fmt::Debug for Sender<'_, T, N> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "Sender")
}
}
#[cfg(feature = "defmt-03")]
-impl<'a, T, const N: usize> defmt::Format for Sender<'a, T, N> {
+impl<T, const N: usize> defmt::Format for Sender<'_, T, N> {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Sender",)
}
}
-impl<'a, T, const N: usize> Sender<'a, T, N> {
+impl<T, const N: usize> Sender<'_, T, N> {
#[inline(always)]
fn send_footer(&mut self, idx: u8, val: T) {
// Write the value to the slots, note; this memcpy is not under a critical section.
@@ -360,7 +363,7 @@ impl<'a, T, const N: usize> Sender<'a, T, N> {
}
}
-impl<'a, T, const N: usize> Drop for Sender<'a, T, N> {
+impl<T, const N: usize> Drop for Sender<'_, T, N> {
fn drop(&mut self) {
// Count down the reference counter
let num_senders = critical_section::with(|cs| {
@@ -376,7 +379,7 @@ impl<'a, T, const N: usize> Drop for Sender<'a, T, N> {
}
}
-impl<'a, T, const N: usize> Clone for Sender<'a, T, N> {
+impl<T, const N: usize> Clone for Sender<'_, T, N> {
fn clone(&self) -> Self {
// Count up the reference counter
critical_section::with(|cs| *self.0.access(cs).num_senders += 1);
@@ -390,16 +393,16 @@ impl<'a, T, const N: usize> Clone for Sender<'a, T, N> {
/// A receiver of the channel. There can only be one receiver at any time.
pub struct Receiver<'a, T, const N: usize>(&'a Channel<T, N>);
-unsafe impl<'a, T, const N: usize> Send for Receiver<'a, T, N> {}
+unsafe impl<T, const N: usize> Send for Receiver<'_, T, N> {}
-impl<'a, T, const N: usize> core::fmt::Debug for Receiver<'a, T, N> {
+impl<T, const N: usize> core::fmt::Debug for Receiver<'_, T, N> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "Receiver")
}
}
#[cfg(feature = "defmt-03")]
-impl<'a, T, const N: usize> defmt::Format for Receiver<'a, T, N> {
+impl<T, const N: usize> defmt::Format for Receiver<'_, T, N> {
fn format(&self, f: defmt::Formatter) {
defmt::write!(f, "Receiver",)
}
@@ -415,7 +418,7 @@ pub enum ReceiveError {
Empty,
}
-impl<'a, T, const N: usize> Receiver<'a, T, N> {
+impl<T, const N: usize> Receiver<'_, T, N> {
/// Receives a value if there is one in the channel, non-blocking.
pub fn try_recv(&mut self) -> Result<T, ReceiveError> {
// Try to get a ready slot.
@@ -487,7 +490,7 @@ impl<'a, T, const N: usize> Receiver<'a, T, N> {
}
}
-impl<'a, T, const N: usize> Drop for Receiver<'a, T, N> {
+impl<T, const N: usize> Drop for Receiver<'_, T, N> {
fn drop(&mut self) {
// Mark the receiver as dropped and wake all waiters
critical_section::with(|cs| *self.0.access(cs).receiver_dropped = true);
diff --git a/rtic-sync/src/signal.rs b/rtic-sync/src/signal.rs
index 47a96cc..a7bef0f 100644
--- a/rtic-sync/src/signal.rs
+++ b/rtic-sync/src/signal.rs
@@ -71,7 +71,7 @@ where
}
}
-impl<'a, T: Copy> SignalWriter<'a, T> {
+impl<T: Copy> SignalWriter<'_, T> {
/// Write a raw Store value to the Signal.
fn write_inner(&mut self, value: Store<T>) {
critical_section::with(|_| {