message: add #[cfg(test)] annotation
diff: @@ -5,10 +5,8 @@ use xaynet_core::{
  use crate::state_machine::{
  events::{DictionaryUpdate, MaskLengthUpdate},
  - phases::{Handler, Phase, PhaseName, PhaseState, Shared, Sum},
  - requests::StateMachineRequest,
  + phases::{Phase, PhaseName, PhaseState, Shared, Sum},
  PhaseStateError,
  - RequestError,
  StateMachine,
  };
  @@ -21,14 +19,6 @@ use sodiumoxide::crypto::hash::sha256;
  #[derive(Debug)]
  pub struct Idle;
  -#[async_trait]
  -impl Handler for PhaseState<Idle> {
  - /// Reject the request with a [`RequestError::MessageRejected`]
  - async fn handle_request(&mut self, _req: StateMachineRequest) -> Result<(), RequestError> {
  - Err(RequestError::MessageRejected)
  - }
  -}
  -
  #[async_trait]
  impl Phase for PhaseState<Idle> {
  const NAME: PhaseName = PhaseName::Idle;
  @@ -145,6 +135,18 @@ impl PhaseState<Idle> {
  }
  }
  +#[cfg(test)]
  +use crate::state_machine::{phases::Handler, requests::StateMachineRequest, RequestError};
  +
  +#[cfg(test)]
  +#[async_trait]
  +impl Handler for PhaseState<Idle> {
  + /// Reject the request with a [`RequestError::MessageRejected`]
  + async fn handle_request(&mut self, _req: StateMachineRequest) -> Result<(), RequestError> {
  + Err(RequestError::MessageRejected)
  + }
  +}
  +
  #[cfg(test)]
  mod test {
  use super::*;
  