diff options
| author | iliana etaoin <[email protected]> | 2025-04-13 00:26:43 -0700 |
|---|---|---|
| committer | iliana etaoin <[email protected]> | 2025-04-13 00:26:43 -0700 |
| commit | db83d7275e63ba2a277f50138a6bd38baedf6937 (patch) | |
| tree | 7354e7e84047945e886390937eba094e43d963f4 /cyw43/src/ioctl.rs | |
| parent | 659c616f9f13aa6f157eaef5279f09805449b5be (diff) | |
cyw43: make State::new a const fn
Diffstat (limited to 'cyw43/src/ioctl.rs')
| -rw-r--r-- | cyw43/src/ioctl.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cyw43/src/ioctl.rs b/cyw43/src/ioctl.rs index af8bb695b..35135e296 100644 --- a/cyw43/src/ioctl.rs +++ b/cyw43/src/ioctl.rs | |||
| @@ -33,8 +33,8 @@ struct Wakers { | |||
| 33 | runner: WakerRegistration, | 33 | runner: WakerRegistration, |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | impl Default for Wakers { | 36 | impl Wakers { |
| 37 | fn default() -> Self { | 37 | const fn new() -> Self { |
| 38 | Self { | 38 | Self { |
| 39 | control: WakerRegistration::new(), | 39 | control: WakerRegistration::new(), |
| 40 | runner: WakerRegistration::new(), | 40 | runner: WakerRegistration::new(), |
| @@ -48,10 +48,10 @@ pub struct IoctlState { | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | impl IoctlState { | 50 | impl IoctlState { |
| 51 | pub fn new() -> Self { | 51 | pub const fn new() -> Self { |
| 52 | Self { | 52 | Self { |
| 53 | state: Cell::new(IoctlStateInner::Done { resp_len: 0 }), | 53 | state: Cell::new(IoctlStateInner::Done { resp_len: 0 }), |
| 54 | wakers: Default::default(), | 54 | wakers: RefCell::new(Wakers::new()), |
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | 57 | ||
