Skip to main content

We don’t need T to be debuggable any mroe

ID
1e62d75
date
2025-01-11 11:10:36+00:00
author
Alex Chan <alex@alexwlchan.net>
parent
d00f763
message
We don't need `T` to be debuggable any mroe
changed files
1 file, 1 addition, 4 deletions

Changed files

src/sampling.rs (5972) → src/sampling.rs (5944)

diff --git a/src/sampling.rs b/src/sampling.rs
index ba679d4..ed08134 100644
--- a/src/sampling.rs
+++ b/src/sampling.rs
@@ -10,10 +10,7 @@ use std::collections::HashMap;
 /// on the Wikipedia page:
 /// https://en.wikipedia.org/wiki/Reservoir_sampling#Optimal:_Algorithm_L
 ///
-pub fn reservoir_sample<T: std::fmt::Debug>(
-    mut items: impl Iterator<Item = T>,
-    k: usize,
-) -> Vec<T> {
+pub fn reservoir_sample<T>(mut items: impl Iterator<Item = T>, k: usize) -> Vec<T> {
     // Taking a sample with k=0 doesn't make much sense in practice,
     // but we include this to avoid problems downstream.
     if k == 0 {