Skip to content

Commit

Permalink
Remove unneeded unsafe from test (metrics-rs#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored Dec 22, 2023
1 parent c579b85 commit 56fcaa4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions metrics-exporter-prometheus/src/distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,10 @@ mod tests {
let (clock, mock) = Clock::mock();
mock.increment(Duration::from_secs(4));

const BUCKET_COUNT: NonZeroU32 = unsafe { NonZeroU32::new_unchecked(2) };
const BUCKET_WIDTH: Duration = Duration::from_secs(5);
let bucket_count = NonZeroU32::new(2).unwrap();
let bucket_width = Duration::from_secs(5);

let mut summary = RollingSummary::new(BUCKET_COUNT, BUCKET_WIDTH);
let mut summary = RollingSummary::new(bucket_count, bucket_width);
assert_eq!(0, summary.buckets().len());
assert_eq!(0, summary.count());

Expand Down

0 comments on commit 56fcaa4

Please sign in to comment.