diff options
Diffstat (limited to 'macros/src')
-rw-r--r-- | macros/src/check.rs | 2 | ||||
-rw-r--r-- | macros/src/codegen/dispatchers.rs | 13 |
2 files changed, 6 insertions, 9 deletions
diff --git a/macros/src/check.rs b/macros/src/check.rs index 4b360738..74df688c 100644 --- a/macros/src/check.rs +++ b/macros/src/check.rs @@ -43,7 +43,7 @@ pub fn app(app: &App, _analysis: &Analysis) -> parse::Result<Extra> { let need = priorities .iter() // Only count if not 0 - .filter_map(|prio| if *prio > 0 { Some(prio) } else { None }) + .filter(|prio| **prio > 0) .count(); let given = app.args.extern_interrupts.len(); if need > given { diff --git a/macros/src/codegen/dispatchers.rs b/macros/src/codegen/dispatchers.rs index 62df4293..6b241140 100644 --- a/macros/src/codegen/dispatchers.rs +++ b/macros/src/codegen/dispatchers.rs @@ -183,14 +183,11 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream } )); - for name in channel.tasks.iter().filter_map(|name| { - let task = &app.software_tasks[name]; - if task.is_async { - Some(name) - } else { - None - } - }) { + for name in channel + .tasks + .iter() + .filter(|name| app.software_tasks[*name].is_async) + { let exec_name = util::internal_task_ident(name, "EXEC"); let executor_run_ident = util::executor_run_ident(name); |