Since there only will be one init/idle use .first().unwrap(), matching rtic-syntax

This commit is contained in:
Henrik Tjäder 2020-09-01 16:12:42 +00:00
parent f151d5871c
commit d8c9476372
5 changed files with 9 additions and 18 deletions

View file

@ -27,9 +27,8 @@ pub fn codegen(
// call_init -- the call to the user `#[init]` if there's one
Option<TokenStream2>,
) {
//if let Some(init) = app.inits.get(&core) {
if app.inits.len() > 0 {
let init = &app.inits[0];
let init = &app.inits.first().unwrap();
let mut needs_lt = false;
let name = &init.name;