From 8eccef7d9cda8a60594b86d31b656a3680d1ca16 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 26 Feb 2019 23:25:16 +0100 Subject: refactor: make `binds` harder to misuse --- macros/src/check.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'macros/src/check.rs') diff --git a/macros/src/check.rs b/macros/src/check.rs index ab86461..4adc2c1 100644 --- a/macros/src/check.rs +++ b/macros/src/check.rs @@ -106,12 +106,8 @@ pub fn app(app: &App) -> parse::Result<()> { } // Check that free interrupts are not being used - for (name, interrupt) in &app.interrupts { - let name = if let Some(ref binds) = interrupt.args.binds { - binds - } else { - name - }; + for (handler, interrupt) in &app.interrupts { + let name = interrupt.args.binds(handler); if app.free_interrupts.contains_key(name) { return Err(parse::Error::new( -- cgit v1.2.3