diff --git a/protocol/src/light.rs b/protocol/src/light.rs index f9ac785..33fa767 100644 --- a/protocol/src/light.rs +++ b/protocol/src/light.rs @@ -13,7 +13,7 @@ pub enum State { } impl State { - pub const fn invert(self) -> Self { + pub const fn inverted(self) -> Self { match self { State::Off => State::On, State::On => State::Off, @@ -95,7 +95,7 @@ where /// Toggle the light by setting it to the inverse of its current state async fn toggle(&mut self) -> Result<(), Self::Error> { let state = self.get_state().await.context(GetStateSnafu)?; - self.set_state(state.invert()) + self.set_state(state.inverted()) .await .context(SetStateSnafu)?;