diff --git a/crates/daphne/src/lib.rs b/crates/daphne/src/lib.rs index 2c8e9b7df..549c94ef0 100644 --- a/crates/daphne/src/lib.rs +++ b/crates/daphne/src/lib.rs @@ -322,10 +322,12 @@ impl std::fmt::Display for DapBatchBucket { } } +type TimestampedReportList = Vec<(ReportId, Time)>; + /// A set of values related to reports in the same bucket. #[derive(Debug)] pub struct DapAggregateSpan { - span: HashMap)>, + span: HashMap, } // We can't derive default because it will require T to be Default, which we don't need. @@ -338,7 +340,7 @@ impl Default for DapAggregateSpan { } impl IntoIterator for DapAggregateSpan { - type IntoIter = )> as IntoIterator>::IntoIter; + type IntoIter = as IntoIterator>::IntoIter; type Item = ::Item; @@ -440,15 +442,15 @@ impl DapAggregateSpan { } /// Return an iterator over the aggregate span. - pub fn iter(&self) -> impl Iterator))> { + pub fn iter(&self) -> impl Iterator { self.span.iter() } } -impl FromIterator<(DapBatchBucket, (T, Vec<(ReportId, Time)>))> for DapAggregateSpan { +impl FromIterator<(DapBatchBucket, (T, TimestampedReportList))> for DapAggregateSpan { fn from_iter(iter: I) -> Self where - I: IntoIterator))>, + I: IntoIterator, { Self { span: iter.into_iter().collect(), @@ -456,10 +458,10 @@ impl FromIterator<(DapBatchBucket, (T, Vec<(ReportId, Time)>))> for DapAggreg } } -impl Extend<(DapBatchBucket, (T, Vec<(ReportId, Time)>))> for DapAggregateSpan { +impl Extend<(DapBatchBucket, (T, TimestampedReportList))> for DapAggregateSpan { fn extend(&mut self, iter: I) where - I: IntoIterator))>, + I: IntoIterator, { self.span.extend(iter); } diff --git a/crates/daphne/src/messages/mod.rs b/crates/daphne/src/messages/mod.rs index 1b1ac3b0d..14b07f19a 100644 --- a/crates/daphne/src/messages/mod.rs +++ b/crates/daphne/src/messages/mod.rs @@ -142,7 +142,7 @@ mod base64url_bytes { O: From<[u8; N]>, { struct Visitor(std::marker::PhantomData<[O; N]>); - impl<'de, const N: usize, O> de::Visitor<'de> for Visitor + impl de::Visitor<'_> for Visitor where O: From<[u8; N]>, { diff --git a/crates/daphne/src/pine/mod.rs b/crates/daphne/src/pine/mod.rs index 42ac73a6b..2eaec2c07 100644 --- a/crates/daphne/src/pine/mod.rs +++ b/crates/daphne/src/pine/mod.rs @@ -359,7 +359,7 @@ fn bits(x: u64) -> usize { } fn chunk_count(chunk_length: usize, length: usize) -> usize { - (length + chunk_length - 1) / chunk_length + length.div_ceil(chunk_length) } fn dst(algorithm_id: u32, usage: u16) -> [u8; DST_SIZE] {