Skip to content

Commit 51547ba

Browse files
committed
zephyr: work: Make Signal::new() just return Self
Instead of `Result<Self, Infallible>`, just return Self, as this cannot ever fail. Signed-off-by: David Brown <[email protected]>
1 parent 9524640 commit 51547ba

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

zephyr/src/work.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ extern crate alloc;
179179

180180
use core::{
181181
cell::UnsafeCell,
182-
convert::Infallible,
183182
ffi::{c_int, c_uint, CStr},
184183
future::Future,
185184
mem,
@@ -393,13 +392,13 @@ impl Signal {
393392
/// Create a new `Signal`.
394393
///
395394
/// The Signal will be in the non-signaled state.
396-
pub fn new() -> Result<Signal, Infallible> {
395+
pub fn new() -> Signal {
397396
// SAFETY: The memory is zero initialized, and Fixed ensure that it never changes address.
398397
let item: Fixed<k_poll_signal> = Fixed::new(unsafe { mem::zeroed() });
399398
unsafe {
400399
k_poll_signal_init(item.get());
401400
}
402-
Ok(Signal { item })
401+
Signal { item }
403402
}
404403

405404
/// Reset the Signal
@@ -469,7 +468,7 @@ impl Signal {
469468

470469
impl Default for Signal {
471470
fn default() -> Self {
472-
Signal::new().unwrap()
471+
Signal::new()
473472
}
474473
}
475474

0 commit comments

Comments
 (0)