aboutsummaryrefslogtreecommitdiff
path: root/macros/src/syntax.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2018-12-16 19:13:22 +0100
committerGravatar Jorge Aparicio <jorge@japaric.io> 2018-12-16 19:14:58 +0100
commit56d09a12dd645166af7d6def6b95bf71ae7962bd (patch)
tree44529dc248cc69772e51daa761d49c5d9ccbdc56 /macros/src/syntax.rs
parent8e9a91d0b09313eee0f7fa44cc827dced0ea1806 (diff)
downloadrtic-56d09a12dd645166af7d6def6b95bf71ae7962bd.tar.gz
rtic-56d09a12dd645166af7d6def6b95bf71ae7962bd.tar.zst
rtic-56d09a12dd645166af7d6def6b95bf71ae7962bd.zip
move macros crate to the 2018 edition
Diffstat (limited to 'macros/src/syntax.rs')
-rw-r--r--macros/src/syntax.rs24
1 files changed, 12 insertions, 12 deletions
diff --git a/macros/src/syntax.rs b/macros/src/syntax.rs
index b9424fbe..85f3caaa 100644
--- a/macros/src/syntax.rs
+++ b/macros/src/syntax.rs
@@ -20,7 +20,7 @@ pub struct AppArgs {
}
impl Parse for AppArgs {
- fn parse(input: ParseStream) -> parse::Result<Self> {
+ fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
let mut device = None;
loop {
if input.is_empty() {
@@ -80,8 +80,8 @@ pub struct Input {
}
impl Parse for Input {
- fn parse(input: ParseStream) -> parse::Result<Self> {
- fn parse_items(input: ParseStream) -> parse::Result<Vec<Item>> {
+ fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
+ fn parse_items(input: ParseStream<'_>) -> parse::Result<Vec<Item>> {
let mut items = vec![];
while !input.is_empty() {
@@ -254,7 +254,7 @@ impl App {
pub fn resource_accesses(&self) -> impl Iterator<Item = (u8, &Ident)> {
self.idle
.as_ref()
- .map(|idle| -> Box<Iterator<Item = _>> {
+ .map(|idle| -> Box<dyn Iterator<Item = _>> {
Box::new(idle.args.resources.iter().map(|res| (0, res)))
})
.unwrap_or_else(|| Box::new(iter::empty()))
@@ -293,7 +293,7 @@ impl App {
.chain(
self.idle
.as_ref()
- .map(|idle| -> Box<Iterator<Item = _>> {
+ .map(|idle| -> Box<dyn Iterator<Item = _>> {
Box::new(idle.args.spawn.iter().map(|s| (Some(0), s)))
})
.unwrap_or_else(|| Box::new(iter::empty())),
@@ -329,7 +329,7 @@ impl App {
.chain(
self.idle
.as_ref()
- .map(|idle| -> Box<Iterator<Item = _>> {
+ .map(|idle| -> Box<dyn Iterator<Item = _>> {
Box::new(idle.args.schedule.iter().map(|s| (Some(0), s)))
})
.unwrap_or_else(|| Box::new(iter::empty())),
@@ -358,7 +358,7 @@ impl App {
pub fn schedule_callers(&self) -> impl Iterator<Item = (Ident, &Idents)> {
self.idle
.as_ref()
- .map(|idle| -> Box<Iterator<Item = _>> {
+ .map(|idle| -> Box<dyn Iterator<Item = _>> {
Box::new(iter::once((
Ident::new("idle", Span::call_site()),
&idle.args.schedule,
@@ -389,7 +389,7 @@ impl App {
pub fn spawn_callers(&self) -> impl Iterator<Item = (Ident, &Idents)> {
self.idle
.as_ref()
- .map(|idle| -> Box<Iterator<Item = _>> {
+ .map(|idle| -> Box<dyn Iterator<Item = _>> {
Box::new(iter::once((
Ident::new("idle", Span::call_site()),
&idle.args.spawn,
@@ -492,7 +492,7 @@ impl Default for InitArgs {
}
impl Parse for InitArgs {
- fn parse(input: ParseStream) -> parse::Result<InitArgs> {
+ fn parse(input: ParseStream<'_>) -> parse::Result<InitArgs> {
if input.is_empty() {
return Ok(InitArgs::default());
}
@@ -662,7 +662,7 @@ pub struct ExceptionArgs {
}
impl Parse for ExceptionArgs {
- fn parse(input: ParseStream) -> parse::Result<Self> {
+ fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
parse_args(input, false).map(
|TaskArgs {
priority,
@@ -853,13 +853,13 @@ impl Default for TaskArgs {
}
impl Parse for TaskArgs {
- fn parse(input: ParseStream) -> parse::Result<Self> {
+ fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
parse_args(input, true)
}
}
// Parser shared by TaskArgs and ExceptionArgs / InterruptArgs
-fn parse_args(input: ParseStream, accept_capacity: bool) -> parse::Result<TaskArgs> {
+fn parse_args(input: ParseStream<'_>, accept_capacity: bool) -> parse::Result<TaskArgs> {
if input.is_empty() {
return Ok(TaskArgs::default());
}