diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-16 18:18:17 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-16 18:18:17 +0000 |
| commit | c2fbb2848851e32b78e79ff9e919538b7d5ab8a0 (patch) | |
| tree | cadf6359329573a79e937afcef2972f2cf01f6b4 /macros/src/check.rs | |
| parent | 5c458fc115393b93b158b7f6770bc81596d97977 (diff) | |
| parent | d35f5bc0b0453c2e98b8398d36bd2ba553edce45 (diff) | |
Merge #114
114: properly handle conditional compilation r=japaric a=japaric
of resources and tasks
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'macros/src/check.rs')
| -rw-r--r-- | macros/src/check.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/macros/src/check.rs b/macros/src/check.rs index f283220..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<Iterator<Item = _>> { Box::new(idle.args.resources.iter()) }) + .map(|idle| -> Box<dyn Iterator<Item = _>> { 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<Iterator<Item = _>> { + .map(|idle| -> Box<dyn Iterator<Item = _>> { Box::new(idle.args.schedule.iter().chain(&idle.args.spawn)) }) .unwrap_or_else(|| Box::new(iter::empty())) @@ -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(), |
