diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2023-01-27 19:33:25 +0100 |
|---|---|---|
| committer | Henrik Tjäder <henrik@tjaders.com> | 2023-03-01 00:33:34 +0100 |
| commit | d23de6282365bbe83099e3d10877bdd435559016 (patch) | |
| tree | 983efb12335eca97a8d598003ea01c8ba67eeb10 | |
| parent | 1baa4a4228cae4576e194174618bf35f5c206959 (diff) | |
Remove parsing on `capacity`
| -rw-r--r-- | rtic/macros/src/syntax/analyze.rs | 3 | ||||
| -rw-r--r-- | rtic/macros/src/syntax/parse.rs | 44 |
2 files changed, 0 insertions, 47 deletions
diff --git a/rtic/macros/src/syntax/analyze.rs b/rtic/macros/src/syntax/analyze.rs index 3ed1487..57f9f2c 100644 --- a/rtic/macros/src/syntax/analyze.rs +++ b/rtic/macros/src/syntax/analyze.rs @@ -367,9 +367,6 @@ pub type SyncTypes = Set<Box<Type>>; /// 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<Task>, } diff --git a/rtic/macros/src/syntax/parse.rs b/rtic/macros/src/syntax/parse.rs index c78453a..72eeeaf 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<Either<HardwareTaskArgs, Sof } let mut binds = None; - let mut capacity = None; let mut priority = None; let mut shared_resources = None; let mut local_resources = None; @@ -220,55 +219,12 @@ fn task_args(tokens: TokenStream2) -> parse::Result<Either<HardwareTaskArgs, Sof )); } - if capacity.is_some() { - return Err(parse::Error::new( - ident.span(), - "hardware tasks can't use the `capacity` argument", - )); - } - // Parse identifier name let ident = content.parse()?; binds = Some(ident); } - "capacity" => { - 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::<u8>().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( |
