Skip to content

Commit

Permalink
refactor(proto): use derive macro to implement Default for KA
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored and seanmonstar committed Nov 16, 2023
1 parent 823d2cb commit b855475
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/proto/h1/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,19 +903,14 @@ impl std::ops::BitAndAssign<bool> for KA {
}
}

#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Default)]
enum KA {
Idle,
#[default]
Busy,
Disabled,
}

impl Default for KA {
fn default() -> KA {
KA::Busy
}
}

impl KA {
fn idle(&mut self) {
*self = KA::Idle;
Expand Down

0 comments on commit b855475

Please sign in to comment.