Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jannes Brands committed Nov 16, 2023
1 parent 48e060a commit f7965dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/object_pool/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,24 +247,24 @@ pub struct Button {

#[derive(Debug, PartialEq, Clone, Copy)]
pub enum ButtonState {
RELEASED,
LATCHED,
Released,
Latched,
}

impl From<ButtonState> for bool {
fn from(value: ButtonState) -> Self {
match value {
ButtonState::RELEASED => false,
ButtonState::LATCHED => true,
ButtonState::Released => false,
ButtonState::Latched => true,
}
}
}

impl From<bool> for ButtonState {
fn from(value: bool) -> Self {
match value {
false => ButtonState::RELEASED,
true => ButtonState::LATCHED,
false => ButtonState::Released,
true => ButtonState::Latched,
}
}
}
Expand Down

0 comments on commit f7965dd

Please sign in to comment.