fix(ds): be consistent about required traits
Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
3fcbbf4f81
commit
12322c9fae
1 changed files with 9 additions and 3 deletions
|
@ -5,8 +5,11 @@ pub struct MinHeap<T> {
|
|||
heap: BinaryHeap<Reverse<T>>,
|
||||
}
|
||||
|
||||
impl<T: Ord> MinHeap<T> {
|
||||
pub fn new() -> MinHeap<T> {
|
||||
impl<T> MinHeap<T>
|
||||
where
|
||||
T: Ord,
|
||||
{
|
||||
pub fn new() -> Self {
|
||||
MinHeap {
|
||||
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 {
|
||||
Self::new()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue