From b85547555f59dc9f36c8ad7934a85a898dd66220 Mon Sep 17 00:00:00 2001 From: tottoto Date: Fri, 17 Nov 2023 01:38:23 +0900 Subject: [PATCH] refactor(proto): use derive macro to implement Default for KA --- src/proto/h1/conn.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/proto/h1/conn.rs b/src/proto/h1/conn.rs index 43fba3b793..3807adb46a 100644 --- a/src/proto/h1/conn.rs +++ b/src/proto/h1/conn.rs @@ -903,19 +903,14 @@ impl std::ops::BitAndAssign 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;