Style cleanup

This commit is contained in:
Benjamin Saunders
2019-03-30 17:10:38 -07:00
committed by Dirkjan Ochtman
parent 3e1f0291b5
commit 309d438ac4
2 changed files with 7 additions and 5 deletions
+2 -4
View File
@@ -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)
+5 -1
View File
@@ -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 {