Implement Debug for Queue

This commit is contained in:
Felix Stegmaier 2019-02-02 14:22:23 +01:00
parent e2fcad0d1e
commit 252ce94d44

View File

@ -2,7 +2,7 @@
use core::cell::UnsafeCell;
use core::marker::PhantomData;
use core::ptr;
use core::{ptr, fmt};
use generic_array::{ArrayLength, GenericArray};
@ -216,6 +216,18 @@ where
}
}
impl<T, N, U, C> fmt::Debug for Queue<T, N, U, C>
where
N: ArrayLength<T>,
T: fmt::Debug,
U: sealed::Uxx,
C: sealed::XCore,
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_list().entries(self.iter()).finish()
}
}
impl<'a, T, N, U, C> IntoIterator for &'a Queue<T, N, U, C>
where
N: ArrayLength<T>,