From fe5673bf20b3734d94e10553338b258fa9cfd386 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Fri, 26 Mar 2021 10:56:59 -0700 Subject: [PATCH] Idiomatic capitalization of EcnCodepoint variants --- quinn-proto/src/connection/mod.rs | 2 +- quinn-proto/src/frame.rs | 6 +++--- quinn-proto/src/shared.rs | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index a73904cea..927be96fe 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -717,7 +717,7 @@ where destination: self.path.remote, contents: buf, ecn: if self.path.sending_ecn { - Some(EcnCodepoint::ECT0) + Some(EcnCodepoint::Ect0) } else { None }, diff --git a/quinn-proto/src/frame.rs b/quinn-proto/src/frame.rs index 9f7199481..668733475 100644 --- a/quinn-proto/src/frame.rs +++ b/quinn-proto/src/frame.rs @@ -383,13 +383,13 @@ pub struct EcnCounts { impl std::ops::AddAssign for EcnCounts { fn add_assign(&mut self, rhs: EcnCodepoint) { match rhs { - EcnCodepoint::ECT0 => { + EcnCodepoint::Ect0 => { self.ect0 += 1; } - EcnCodepoint::ECT1 => { + EcnCodepoint::Ect1 => { self.ect1 += 1; } - EcnCodepoint::CE => { + EcnCodepoint::Ce => { self.ce += 1; } } diff --git a/quinn-proto/src/shared.rs b/quinn-proto/src/shared.rs index 66e9e1962..f5634e7f7 100644 --- a/quinn-proto/src/shared.rs +++ b/quinn-proto/src/shared.rs @@ -128,11 +128,11 @@ impl fmt::Display for ConnectionId { #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum EcnCodepoint { #[doc(hidden)] - ECT0 = 0b10, + Ect0 = 0b10, #[doc(hidden)] - ECT1 = 0b01, + Ect1 = 0b01, #[doc(hidden)] - CE = 0b11, + Ce = 0b11, } impl EcnCodepoint { @@ -140,9 +140,9 @@ impl EcnCodepoint { pub fn from_bits(x: u8) -> Option { use self::EcnCodepoint::*; Some(match x & 0b11 { - 0b10 => ECT0, - 0b01 => ECT1, - 0b11 => CE, + 0b10 => Ect0, + 0b01 => Ect1, + 0b11 => Ce, _ => { return None; }