Skip to content

Commit

Permalink
Make Collector generic over Vec<Collector>
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Vasiliu <[email protected]>
  • Loading branch information
vladvasiliu committed Jul 26, 2022
1 parent 13e23f8 commit 5d1424a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,13 @@ where
}
}

impl<'a, M> Collector<'a, M> for Vec<&'a Registry<M>>
impl<'a, M, C> Collector<'a, M> for Vec<&'a C>
where
M: SendSyncEncodeMetric + 'a,
C: Collector<'a, M>,
{
fn collect(&'a self) -> Vec<&'a (Descriptor, M)> {
self.iter()
.flat_map(|r| r.iter().collect::<Vec<&'a (Descriptor, M)>>())
.collect()
self.iter().flat_map(|r| r.collect()).collect()
}
}

Expand Down

0 comments on commit 5d1424a

Please sign in to comment.