forked from ROMEO/nexosim
derive Default
for State
in observables e.g.
This commit is contained in:
parent
b77a4eaa5f
commit
3530cc3405
@ -48,18 +48,14 @@ pub enum ModeId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Processor state.
|
/// Processor state.
|
||||||
|
#[derive(Default)]
|
||||||
pub enum State {
|
pub enum State {
|
||||||
|
#[default]
|
||||||
Off,
|
Off,
|
||||||
Idle,
|
Idle,
|
||||||
Processing(AutoActionKey),
|
Processing(AutoActionKey),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for State {
|
|
||||||
fn default() -> Self {
|
|
||||||
State::Off
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Observable<ModeId> for State {
|
impl Observable<ModeId> for State {
|
||||||
fn observe(&self) -> ModeId {
|
fn observe(&self) -> ModeId {
|
||||||
match *self {
|
match *self {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user