Improve RocList's Debug implementation

This commit is contained in:
Richard Feldman 2022-08-15 10:58:55 -04:00
parent 52dc1fb723
commit 97fef48864
No known key found for this signature in database
GPG Key ID: F1F21AA5B1D9E43B

View File

@ -4,7 +4,7 @@ use core::{
cell::Cell,
cmp::{self, Ordering},
ffi::c_void,
fmt::Debug,
fmt::{self, Debug},
hash::Hash,
intrinsics::copy_nonoverlapping,
iter::FromIterator,
@ -421,8 +421,10 @@ impl<T> Debug for RocList<T>
where
T: Debug,
{
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
self.deref().fmt(f)
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("RocList ")?;
f.debug_list().entries(self.iter()).finish()
}
}