From d8c9476372e25799224d0225bb12c9a9fe043743 Mon Sep 17 00:00:00 2001 From: Henrik Tjäder Date: Tue, 1 Sep 2020 16:12:42 +0000 Subject: Since there only will be one init/idle use .first().unwrap(), matching rtic-syntax --- macros/src/codegen/resources_struct.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'macros/src/codegen/resources_struct.rs') diff --git a/macros/src/codegen/resources_struct.rs b/macros/src/codegen/resources_struct.rs index bd92a599..0c5efd3a 100644 --- a/macros/src/codegen/resources_struct.rs +++ b/macros/src/codegen/resources_struct.rs @@ -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, }; -- cgit v1.2.3