Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jadamcrain committed Jan 15, 2024
1 parent 8d43a78 commit a85627c
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions dnp3/src/outstation/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,15 +316,13 @@ impl NextIdleAction {
fn select_earliest(self, instant: Option<tokio::time::Instant>) -> Self {
match instant {
None => self,
Some(instant) => {
match self {
NextIdleAction::NoSleep => self,
NextIdleAction::SleepUntilEvent => Self::SleepUnit(instant),
NextIdleAction::SleepUnit(other) => {
Self::SleepUnit(tokio::time::Instant::min(instant, other))
}
Some(instant) => match self {
NextIdleAction::NoSleep => self,
NextIdleAction::SleepUntilEvent => Self::SleepUnit(instant),
NextIdleAction::SleepUnit(other) => {
Self::SleepUnit(tokio::time::Instant::min(instant, other))
}
}
},
}
}
}
Expand Down Expand Up @@ -509,7 +507,6 @@ impl OutstationSession {
writer: &mut TransportWriter,
database: &mut DatabaseHandle,
) -> Result<NextIdleAction, RunError> {

if self.config.unsolicited.is_disabled() {
return Ok(NextIdleAction::SleepUntilEvent);
}
Expand Down Expand Up @@ -878,7 +875,7 @@ impl OutstationSession {
async fn sleep_until(&mut self, next_action: NextIdleAction) -> Result<(), RunError> {
async fn sleep_only(next_action: NextIdleAction) {
match next_action {
NextIdleAction::NoSleep => {},
NextIdleAction::NoSleep => {}
NextIdleAction::SleepUnit(x) => tokio::time::sleep_until(x).await,
NextIdleAction::SleepUntilEvent => crate::util::future::forever().await,
}
Expand Down

0 comments on commit a85627c

Please sign in to comment.