Skip to content

Commit 8d73e8f

Browse files
committed
Make Debug impl a bit more useful
1 parent 4850993 commit 8d73e8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/exactly_one_err.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ where
7373
impl<I> ExactSizeIterator for ExactlyOneError<I> where I: ExactSizeIterator {}
7474

7575
impl<I> Display for ExactlyOneError<I>
76-
where I: Iterator
76+
where I: Iterator,
7777
{
7878
fn fmt(&self, f: &mut Formatter) -> FmtResult {
7979
let additional = self.additional_len();
@@ -86,25 +86,25 @@ impl<I> Display for ExactlyOneError<I>
8686
}
8787

8888
impl<I> Debug for ExactlyOneError<I>
89-
where I: Iterator,
89+
where I: Iterator + Debug,
9090
I::Item: Debug,
9191
{
9292
fn fmt(&self, f: &mut Formatter) -> FmtResult {
9393
match &self.first_two {
9494
Some(Either::Left([first, second])) => {
95-
write!(f, "ExactlyOneError[{:?}, {:?}, ...]", first, second)
95+
write!(f, "ExactlyOneError[First: {:?}, Second: {:?}, RemainingIter: {:?}]", first, second, self.inner)
9696
},
9797
Some(Either::Right(second)) => {
98-
write!(f, "ExactlyOneError[{:?}, ...]", second)
98+
write!(f, "ExactlyOneError[Second: {:?}, RemainingIter: {:?}]", second, self.inner)
9999
}
100100
None => {
101-
write!(f, "ExactlyOneError[...]")
101+
write!(f, "ExactlyOneError[RemainingIter: {:?}]", self.inner)
102102
}
103103
}
104104
}
105105
}
106106

107107
#[cfg(feature = "use_std")]
108-
impl<I> Error for ExactlyOneError<I> where I: Iterator, I::Item: Debug, {}
108+
impl<I> Error for ExactlyOneError<I> where I: Iterator + Debug, I::Item: Debug, {}
109109

110110

0 commit comments

Comments
 (0)