Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions freertos-rust/src/critical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<T> ExclusiveData<T> {
}
}

pub fn lock(&self) -> Result<ExclusiveDataGuard<T>, FreeRtosError> {
pub fn lock(&self) -> Result<ExclusiveDataGuard<'_, T>, FreeRtosError> {
Ok(ExclusiveDataGuard {
__data: &self.data,
__lock: CriticalRegion::enter(),
Expand All @@ -47,7 +47,7 @@ impl<T> ExclusiveData<T> {
pub fn lock_from_isr(
&self,
_context: &mut crate::isr::InterruptContext,
) -> Result<ExclusiveDataGuardIsr<T>, FreeRtosError> {
) -> Result<ExclusiveDataGuardIsr<'_, T>, FreeRtosError> {
Ok(ExclusiveDataGuardIsr { __data: &self.data })
}
}
Expand Down Expand Up @@ -106,7 +106,7 @@ impl<T> SuspendScheduler<T> {
}
}

pub fn lock(&self) -> SuspendSchedulerGuard<T> {
pub fn lock(&self) -> SuspendSchedulerGuard<'_,T> {
unsafe {
freertos_rs_vTaskSuspendAll();
}
Expand Down
2 changes: 1 addition & 1 deletion freertos-rust/src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ where
}

/// Try to obtain a lock and mutable access to our inner value
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<MutexGuard<T, M>, FreeRtosError> {
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<MutexGuard<'_, T, M>, FreeRtosError> {
self.mutex.take(max_wait)?;

Ok(MutexGuard {
Expand Down
2 changes: 1 addition & 1 deletion freertos-rust/src/semaphore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Semaphore {
}

/// Lock this semaphore in a RAII fashion
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<SemaphoreGuard, FreeRtosError> {
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<SemaphoreGuard<'_>, FreeRtosError> {
self.take(max_wait).map(|()| SemaphoreGuard { owner: self })
}

Expand Down