diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-07-09 01:49:31 +0200 |
|---|---|---|
| committer | diondokter <[email protected]> | 2025-08-29 13:23:21 +0200 |
| commit | 8aec341f28a00012e1771d5c35d2647e11830755 (patch) | |
| tree | 28ec3bad05e5dcb6ec949493688111839bb6865b /embassy-executor-macros/src/macros/main.rs | |
| parent | 34ff67cdbf25e278ff99bd4a05b6b8c6a30fa5d1 (diff) | |
executor: return error when creating the spawntoken, not when spawning.
Diffstat (limited to 'embassy-executor-macros/src/macros/main.rs')
| -rw-r--r-- | embassy-executor-macros/src/macros/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-executor-macros/src/macros/main.rs b/embassy-executor-macros/src/macros/main.rs index a0e7b3401..fcc04d9c0 100644 --- a/embassy-executor-macros/src/macros/main.rs +++ b/embassy-executor-macros/src/macros/main.rs | |||
| @@ -181,7 +181,7 @@ For example: `#[embassy_executor::main(entry = ..., executor = \"some_crate::Exe | |||
| 181 | let mut executor = #executor::new(); | 181 | let mut executor = #executor::new(); |
| 182 | let executor = unsafe { __make_static(&mut executor) }; | 182 | let executor = unsafe { __make_static(&mut executor) }; |
| 183 | executor.run(|spawner| { | 183 | executor.run(|spawner| { |
| 184 | spawner.must_spawn(__embassy_main(spawner)); | 184 | spawner.spawn(__embassy_main(spawner).unwrap()); |
| 185 | }) | 185 | }) |
| 186 | }, | 186 | }, |
| 187 | ), | 187 | ), |
| @@ -191,7 +191,7 @@ For example: `#[embassy_executor::main(entry = ..., executor = \"some_crate::Exe | |||
| 191 | let executor = ::std::boxed::Box::leak(::std::boxed::Box::new(#executor::new())); | 191 | let executor = ::std::boxed::Box::leak(::std::boxed::Box::new(#executor::new())); |
| 192 | 192 | ||
| 193 | executor.start(|spawner| { | 193 | executor.start(|spawner| { |
| 194 | spawner.must_spawn(__embassy_main(spawner)); | 194 | spawner.spawn(__embassy_main(spawner).unwrap()); |
| 195 | }); | 195 | }); |
| 196 | 196 | ||
| 197 | Ok(()) | 197 | Ok(()) |
