Skip to content

Commit cc36fb5

Browse files
committed
zephyr: sync: mutex: clippy: make LockGuard Infallible
This Mutex type's `lock` method can never fail. Indicate this by making the return value `Infallible`. Signed-off-by: David Brown <[email protected]>
1 parent 580d676 commit cc36fb5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

zephyr/src/sync/mutex.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
use core::{
88
cell::UnsafeCell,
9+
convert::Infallible,
910
fmt,
1011
marker::PhantomData,
1112
ops::{Deref, DerefMut},
@@ -15,7 +16,7 @@ use crate::sys::sync as sys;
1516
use crate::time::{Forever, NoWait};
1617

1718
/// Until poisoning is implemented, mutexes never return an error, and we just get back the guard.
18-
pub type LockResult<Guard> = Result<Guard, ()>;
19+
pub type LockResult<Guard> = Result<Guard, Infallible>;
1920

2021
/// The return type from [`Mutex::try_lock`].
2122
///

0 commit comments

Comments
 (0)