diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2019-08-20 15:11:24 +0200 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2019-08-20 15:17:37 +0200 |
| commit | 0e146f8d1142672725b6abb38478f503a9261c80 (patch) | |
| tree | 846aedddb91908ac831cd15f7877d5ccfbd9a039 /macros/src/check.rs | |
| parent | 2f4f1857788a3c2c5e8b97a5b7cc2c39c26c659f (diff) | |
adapt to changes in rtfm-syntax
Diffstat (limited to 'macros/src/check.rs')
| -rw-r--r-- | macros/src/check.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/macros/src/check.rs b/macros/src/check.rs index 85fda75..0136370 100644 --- a/macros/src/check.rs +++ b/macros/src/check.rs @@ -169,9 +169,10 @@ pub fn app<'a>(app: &'a App, analysis: &Analysis) -> parse::Result<Extra<'a>> { peripherals = if *x { Some(0) } else { None } } - CustomArg::UInt(x) if app.args.cores != 1 => { - peripherals = if *x < u64::from(app.args.cores) { - Some(*x as u8) + CustomArg::UInt(s) if app.args.cores != 1 => { + let x = s.parse::<u8>().ok(); + peripherals = if x.is_some() && x.unwrap() < app.args.cores { + Some(x.unwrap()) } else { return Err(parse::Error::new( k.span(), |
