diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/src/updates.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/src/updates.rs b/net/src/updates.rs index f4ff91dc..8313cd62 100644 --- a/net/src/updates.rs +++ b/net/src/updates.rs @@ -79,7 +79,7 @@ impl Manifest { /// Iterates over all epochs contained in this Update Manifest. pub fn epochs(&self) -> impl Iterator<Item = Epoch> { (self.start.0..self.end.0 + 1).into_iter() - .map(|n| Epoch(n)) + .map(Epoch) } /// Returns the start epoch. @@ -218,12 +218,12 @@ impl Epoch { /// Returns the previous Epoch, if any. pub fn pred(&self) -> Option<Epoch> { - self.0.checked_sub(1).map(|e| Epoch(e)) + self.0.checked_sub(1).map(Epoch) } /// Returns the next Epoch, if any. pub fn succ(&self) -> Option<Epoch> { - self.0.checked_add(1).map(|e| Epoch(e)) + self.0.checked_add(1).map(Epoch) } /// Returns an iterator over all epochs starting from this one to @@ -231,7 +231,7 @@ impl Epoch { pub fn since(&self, other: Epoch) -> anyhow::Result<impl Iterator<Item = Epoch>> { if other <= *self { - Ok((other.0 + 1..self.0).into_iter().rev().map(|e| Epoch(e))) + Ok((other.0 + 1..self.0).into_iter().rev().map(Epoch)) } else { Err(anyhow::anyhow!("other is later than self")) } |