diff options
| author | Tyler <[email protected]> | 2023-09-29 20:02:24 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-29 20:02:24 -0600 |
| commit | 2f9b59c5cf21f1e2761a9ccefdfd86f0edea829c (patch) | |
| tree | 8964744b4fb753cf98f6f413464106c4d2a72976 /embassy-executor/src/raw/util.rs | |
| parent | ce91fb2bfc846570ef543a09396c428d70675245 (diff) | |
| parent | 95b3d9eb3b3657de3d7bc9c04f8fb83eae901640 (diff) | |
Merge branch 'main' into issue-1974-add-sai-driver
Diffstat (limited to 'embassy-executor/src/raw/util.rs')
| -rw-r--r-- | embassy-executor/src/raw/util.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/embassy-executor/src/raw/util.rs b/embassy-executor/src/raw/util.rs index e2e8f4df8..c46085e45 100644 --- a/embassy-executor/src/raw/util.rs +++ b/embassy-executor/src/raw/util.rs | |||
| @@ -17,8 +17,9 @@ impl<T> UninitCell<T> { | |||
| 17 | &mut *self.as_mut_ptr() | 17 | &mut *self.as_mut_ptr() |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | pub unsafe fn write(&self, val: T) { | 20 | #[inline(never)] |
| 21 | ptr::write(self.as_mut_ptr(), val) | 21 | pub unsafe fn write_in_place(&self, func: impl FnOnce() -> T) { |
| 22 | ptr::write(self.as_mut_ptr(), func()) | ||
| 22 | } | 23 | } |
| 23 | 24 | ||
| 24 | pub unsafe fn drop_in_place(&self) { | 25 | pub unsafe fn drop_in_place(&self) { |
