1
0
Fork 0

fix(ds): be consistent about required traits

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2023-12-17 18:24:10 +01:00
parent 3fcbbf4f81
commit 12322c9fae
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

@ -5,8 +5,11 @@ pub struct MinHeap<T> {
heap: BinaryHeap<Reverse<T>>, heap: BinaryHeap<Reverse<T>>,
} }
impl<T: Ord> MinHeap<T> { impl<T> MinHeap<T>
pub fn new() -> MinHeap<T> { where
T: Ord,
{
pub fn new() -> Self {
MinHeap { MinHeap {
heap: BinaryHeap::new(), heap: BinaryHeap::new(),
} }
@ -21,7 +24,10 @@ impl<T: Ord> MinHeap<T> {
} }
} }
impl<T: Ord> Default for MinHeap<T> { impl<T> Default for MinHeap<T>
where
T: Ord,
{
fn default() -> Self { fn default() -> Self {
Self::new() Self::new()
} }