Skip to content

Commit 9c0c565

Browse files
committed
feat: implement Debug for Deque
1 parent 59bc89f commit 9c0c565

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/deque.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use core::fmt;
12
use core::iter::FusedIterator;
23
use core::marker::PhantomData;
34
use core::mem::MaybeUninit;
@@ -374,6 +375,12 @@ impl<T, const N: usize> Drop for Deque<T, N> {
374375
}
375376
}
376377

378+
impl<T: fmt::Debug, const N: usize> fmt::Debug for Deque<T, N> {
379+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
380+
f.debug_list().entries(self).finish()
381+
}
382+
}
383+
377384
/// An iterator that moves out of a [`Deque`].
378385
///
379386
/// This struct is created by calling the `into_iter` method.

0 commit comments

Comments
 (0)