Skip to content

Commit

Permalink
Address clippy comments
Browse files Browse the repository at this point in the history
  • Loading branch information
romancardenas committed Jul 3, 2024
1 parent 84a93e0 commit 1ca17b6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
15 changes: 11 additions & 4 deletions macros/src/component/coupled/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use syn::{

pub struct Component {
pub ident: Ident,
pub colon: Token![:],
pub _colon: Token![:],
pub ty: Type,
}

Expand All @@ -18,12 +18,16 @@ impl Parse for Component {
let ident = input.parse()?;
let colon = input.parse()?;
let ty = input.parse()?;
Ok(Self { ident, colon, ty })
Ok(Self {
ident,
_colon: colon,
ty,
})
}
}

pub struct Components {
pub brace: Brace,
pub _brace: Brace,
pub components: Vec<Component>,
}

Expand Down Expand Up @@ -71,6 +75,9 @@ impl Parse for Components {
}
}

Ok(Self { brace, components })
Ok(Self {
_brace: brace,
components,
})
}
}
7 changes: 5 additions & 2 deletions macros/src/component/coupled/coupling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl Parse for Coupling {
}

pub struct Couplings {
pub brace: Brace,
pub _brace: Brace,
pub couplings: Vec<Coupling>,
}

Expand Down Expand Up @@ -133,6 +133,9 @@ impl Parse for Couplings {
content.parse::<Token![,]>()?; // comma between meta arguments
}
}
Ok(Self { brace, couplings })
Ok(Self {
_brace: brace,
couplings,
})
}
}
12 changes: 6 additions & 6 deletions src/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ impl<M: AbstractSimulator> Simulator<M> {
/// It provides support for real time execution via the following arguments:
///
/// - `wait_until`: a closure that is called between state transitions.
/// It receives the time of the next state transition and a mutable reference to the input ports.
/// It returns the actual time "waited".
/// If the returned time is equal to the input time, an internal/confluent state transition is performed.
/// Otherwise, it assumes that an external event happened and executes the external transition function.
/// It receives the time of the next state transition and a mutable reference to the input ports.
/// It returns the actual time "waited".
/// If the returned time is equal to the input time, an internal/confluent state transition is performed.
/// Otherwise, it assumes that an external event happened and executes the external transition function.
/// - `propagate_output`: a closure that is called after output functions.
/// It receives a mutable reference to the output ports so the closure can access to output events.
/// Feel free to ignore this argument if you do not need to propagate output messages.
/// It receives a mutable reference to the output ports so the closure can access to output events.
/// Feel free to ignore this argument if you do not need to propagate output messages.
#[inline]
pub fn simulate_rt(
&mut self,
Expand Down

0 comments on commit 1ca17b6

Please sign in to comment.