File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
opentelemetry-proto/src/transform
opentelemetry-sdk/src/metrics/data Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -250,11 +250,11 @@ pub mod tonic {
250250 zero_count : dp. zero_count ( ) ,
251251 positive : Some ( TonicBuckets {
252252 offset : dp. positive_bucket ( ) . offset ( ) ,
253- bucket_counts : dp. positive_bucket ( ) . counts ( ) . to_vec ( ) ,
253+ bucket_counts : dp. positive_bucket ( ) . counts ( ) . collect ( ) ,
254254 } ) ,
255255 negative : Some ( TonicBuckets {
256256 offset : dp. negative_bucket ( ) . offset ( ) ,
257- bucket_counts : dp. negative_bucket ( ) . counts ( ) . to_vec ( ) ,
257+ bucket_counts : dp. negative_bucket ( ) . counts ( ) . collect ( ) ,
258258 } ) ,
259259 flags : TonicDataPointFlags :: default ( ) as u32 ,
260260 exemplars : dp. exemplars ( ) . map ( Into :: into) . collect ( ) ,
Original file line number Diff line number Diff line change @@ -562,9 +562,9 @@ impl ExponentialBucket {
562562 self . offset
563563 }
564564
565- /// Returns a reference to the counts vec .
566- pub fn counts ( & self ) -> & [ u64 ] {
567- & self . counts
565+ /// Returns an iterator over the counts.
566+ pub fn counts ( & self ) -> impl Iterator < Item = u64 > + ' _ {
567+ self . counts . iter ( ) . copied ( )
568568 }
569569}
570570
You can’t perform that action at this time.
0 commit comments