From a04f127a094a18031195d0d6ce538ae38983e401 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Fri, 27 Jan 2023 19:33:25 +0100 Subject: [PATCH] Remove parsing on `capacity` --- rtic/macros/src/syntax/analyze.rs | 3 --- rtic/macros/src/syntax/parse.rs | 44 ------------------------------- 2 files changed, 47 deletions(-) diff --git a/rtic/macros/src/syntax/analyze.rs b/rtic/macros/src/syntax/analyze.rs index 3ed1487741..57f9f2cdaf 100644 --- a/rtic/macros/src/syntax/analyze.rs +++ b/rtic/macros/src/syntax/analyze.rs @@ -367,9 +367,6 @@ pub type SyncTypes = Set>; /// A channel used to send messages #[derive(Debug, Default)] pub struct Channel { - /// The channel capacity - pub capacity: u8, - /// Tasks that can be spawned on this channel pub tasks: BTreeSet, } diff --git a/rtic/macros/src/syntax/parse.rs b/rtic/macros/src/syntax/parse.rs index c78453a437..72eeeaf69c 100644 --- a/rtic/macros/src/syntax/parse.rs +++ b/rtic/macros/src/syntax/parse.rs @@ -191,7 +191,6 @@ fn task_args(tokens: TokenStream2) -> parse::Result parse::Result { - if capacity.is_some() { - return Err(parse::Error::new( - ident.span(), - "argument appears more than once", - )); - } - - if binds.is_some() { - return Err(parse::Error::new( - ident.span(), - "hardware tasks can't use the `capacity` argument", - )); - } - - // #lit - let lit: LitInt = content.parse()?; - - if !lit.suffix().is_empty() { - return Err(parse::Error::new( - lit.span(), - "this literal must be unsuffixed", - )); - } - - let value = lit.base10_parse::().ok(); - if value.is_none() || value == Some(0) { - return Err(parse::Error::new( - lit.span(), - "this literal must be in the range 1...255", - )); - } - - capacity = Some(value.unwrap()); - } - "priority" => { if priority.is_some() { return Err(parse::Error::new(