diff --git a/src/structure/heap.rs b/src/structure/heap.rs index 14a3c86..a3c9077 100644 --- a/src/structure/heap.rs +++ b/src/structure/heap.rs @@ -1,4 +1,5 @@ use core::ops::{Deref, DerefMut}; +use std::fmt::Display; macro_rules! left_child { ($parent:ident) => { @@ -74,6 +75,14 @@ where }; } } +impl Display for Heap +where + T: core::fmt::Debug, +{ + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + return write!(f, "{:?}", self.items); + } +} #[allow(dead_code)] impl Heap {