mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-25 04:35:17 +00:00
Idiomatic capitalization of EcnCodepoint variants
This commit is contained in:
committed by
Dirkjan Ochtman
parent
5e68a8681e
commit
fe5673bf20
@@ -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
|
||||
},
|
||||
|
||||
@@ -383,13 +383,13 @@ pub struct EcnCounts {
|
||||
impl std::ops::AddAssign<EcnCodepoint> 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<Self> {
|
||||
use self::EcnCodepoint::*;
|
||||
Some(match x & 0b11 {
|
||||
0b10 => ECT0,
|
||||
0b01 => ECT1,
|
||||
0b11 => CE,
|
||||
0b10 => Ect0,
|
||||
0b01 => Ect1,
|
||||
0b11 => Ce,
|
||||
_ => {
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user