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

@ -14,8 +14,8 @@ pub fn codegen(
let mut lt = None;
let resources = match ctxt {
Context::Init => &app.inits[0].args.resources,
Context::Idle => &app.idles[0].args.resources,
Context::Init => &app.inits.first().unwrap().args.resources,
Context::Idle => &app.idles.first().unwrap().args.resources,
Context::HardwareTask(name) => &app.hardware_tasks[name].args.resources,
Context::SoftwareTask(name) => &app.software_tasks[name].args.resources,
};