From 8e9a91d0b09313eee0f7fa44cc827dced0ea1806 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 16 Dec 2018 19:10:36 +0100 Subject: properly handle `#[cfg]` (conditional compilation) on tasks --- macros/src/check.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'macros/src/check.rs') diff --git a/macros/src/check.rs b/macros/src/check.rs index f283220..8518459 100644 --- a/macros/src/check.rs +++ b/macros/src/check.rs @@ -73,7 +73,8 @@ pub fn app(app: &App) -> parse::Result<()> { app.tasks .values() .flat_map(|t| t.args.schedule.iter().chain(&t.args.spawn)), - ) { + ) + { if !app.tasks.contains_key(task) { return Err(parse::Error::new( task.span(), -- cgit v1.2.3 From 56d09a12dd645166af7d6def6b95bf71ae7962bd Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 16 Dec 2018 19:13:22 +0100 Subject: move macros crate to the 2018 edition --- macros/src/check.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'macros/src/check.rs') diff --git a/macros/src/check.rs b/macros/src/check.rs index 8518459..ae2262a 100644 --- a/macros/src/check.rs +++ b/macros/src/check.rs @@ -3,14 +3,14 @@ use std::{collections::HashSet, iter}; use proc_macro2::Span; use syn::parse; -use syntax::App; +use crate::syntax::App; pub fn app(app: &App) -> parse::Result<()> { // Check that all referenced resources have been declared for res in app .idle .as_ref() - .map(|idle| -> Box> { Box::new(idle.args.resources.iter()) }) + .map(|idle| -> Box> { Box::new(idle.args.resources.iter()) }) .unwrap_or_else(|| Box::new(iter::empty())) .chain(&app.init.args.resources) .chain(app.exceptions.values().flat_map(|e| &e.args.resources)) @@ -53,7 +53,7 @@ pub fn app(app: &App) -> parse::Result<()> { for task in app .idle .as_ref() - .map(|idle| -> Box> { + .map(|idle| -> Box> { Box::new(idle.args.schedule.iter().chain(&idle.args.spawn)) }) .unwrap_or_else(|| Box::new(iter::empty())) -- cgit v1.2.3