Skip to content

Commit 5ccff61

Browse files
committed
Remove mtm argument from the closure in MainThreadBound::get_on_main
1 parent 342675f commit 5ccff61

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

crates/icrate/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1818
- `refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset`
1919
- `refitAccelerationStructure_descriptor_destination_scratchBuffer_scratchBufferOffset_options`
2020

21+
### Removed
22+
* **BREAKING**: Removed the `MainThreadMarker` argument from the closure
23+
passed to `MainThreadBound::get_on_main`.
24+
2125

2226
## icrate 0.0.4 - 2023-07-31
2327

crates/icrate/src/Foundation/additions/thread.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@ impl<T> MainThreadBound<T> {
311311
#[inline]
312312
pub fn get_on_main<F, R>(&self, f: F) -> R
313313
where
314-
F: Send + FnOnce(&T, MainThreadMarker) -> R,
314+
F: Send + FnOnce(&T) -> R,
315315
R: Send,
316316
{
317-
MainThreadMarker::run_on_main(|mtm| f(self.get(mtm), mtm))
317+
MainThreadMarker::run_on_main(|mtm| f(self.get(mtm)))
318318
}
319319

320320
/// Access the item mutably on the main thread.
@@ -323,10 +323,10 @@ impl<T> MainThreadBound<T> {
323323
#[inline]
324324
pub fn get_on_main_mut<F, R>(&mut self, f: F) -> R
325325
where
326-
F: Send + FnOnce(&mut T, MainThreadMarker) -> R,
326+
F: Send + FnOnce(&mut T) -> R,
327327
R: Send,
328328
{
329-
MainThreadMarker::run_on_main(|mtm| f(self.get_mut(mtm), mtm))
329+
MainThreadMarker::run_on_main(|mtm| f(self.get_mut(mtm)))
330330
}
331331
}
332332

0 commit comments

Comments
 (0)