mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-21 02:33:23 +00:00
Style cleanup
This commit is contained in:
committed by
Dirkjan Ochtman
parent
3e1f0291b5
commit
309d438ac4
@@ -2155,10 +2155,8 @@ impl Connection {
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
let id = SpaceId::VALUES
|
||||
.iter()
|
||||
.find(|&&x| self.space(x).crypto.is_some() && self.space(x).can_send())
|
||||
.cloned()
|
||||
let id = SpaceId::iter()
|
||||
.find(|&x| self.space(x).crypto.is_some() && self.space(x).can_send())
|
||||
.or_else(|| {
|
||||
if self.space(SpaceId::Data).crypto.is_some() && self.can_send_1rtt() {
|
||||
Some(SpaceId::Data)
|
||||
|
||||
@@ -797,7 +797,11 @@ pub enum SpaceId {
|
||||
}
|
||||
|
||||
impl SpaceId {
|
||||
pub const VALUES: [Self; 3] = [SpaceId::Initial, SpaceId::Handshake, SpaceId::Data];
|
||||
pub fn iter() -> impl Iterator<Item = Self> {
|
||||
[SpaceId::Initial, SpaceId::Handshake, SpaceId::Data]
|
||||
.into_iter()
|
||||
.cloned()
|
||||
}
|
||||
}
|
||||
|
||||
impl slog::Value for SpaceId {
|
||||
|
||||
Reference in New Issue
Block a user