diff --git a/src/data_structures/min_heap.rs b/src/data_structures/min_heap.rs index 9dfe509..323ff2e 100644 --- a/src/data_structures/min_heap.rs +++ b/src/data_structures/min_heap.rs @@ -5,8 +5,11 @@ pub struct MinHeap { heap: BinaryHeap>, } -impl MinHeap { - pub fn new() -> MinHeap { +impl MinHeap +where + T: Ord, +{ + pub fn new() -> Self { MinHeap { heap: BinaryHeap::new(), } @@ -21,7 +24,10 @@ impl MinHeap { } } -impl Default for MinHeap { +impl Default for MinHeap +where + T: Ord, +{ fn default() -> Self { Self::new() }