Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExactlyOneError: prettier Debug implementation #861

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 5 additions & 13 deletions src/exactly_one_err.rs
Expand Up @@ -102,25 +102,17 @@
I::Item: Debug,
{
fn fmt(&self, f: &mut Formatter) -> FmtResult {
let mut dbg = f.debug_struct("ExactlyOneError");

Check warning on line 105 in src/exactly_one_err.rs

View check run for this annotation

Codecov / codecov/patch

src/exactly_one_err.rs#L105

Added line #L105 was not covered by tests
match &self.first_two {
Some(Either::Left([first, second])) => {
write!(
f,
"ExactlyOneError[First: {:?}, Second: {:?}, RemainingIter: {:?}]",
first, second, self.inner
)
dbg.field("first", first).field("second", second);

Check warning on line 108 in src/exactly_one_err.rs

View check run for this annotation

Codecov / codecov/patch

src/exactly_one_err.rs#L108

Added line #L108 was not covered by tests
}
Some(Either::Right(second)) => {
write!(
f,
"ExactlyOneError[Second: {:?}, RemainingIter: {:?}]",
second, self.inner
)
}
None => {
write!(f, "ExactlyOneError[RemainingIter: {:?}]", self.inner)
dbg.field("second", second);

Check warning on line 111 in src/exactly_one_err.rs

View check run for this annotation

Codecov / codecov/patch

src/exactly_one_err.rs#L111

Added line #L111 was not covered by tests
}
None => {}

Check warning on line 113 in src/exactly_one_err.rs

View check run for this annotation

Codecov / codecov/patch

src/exactly_one_err.rs#L113

Added line #L113 was not covered by tests
}
dbg.field("inner", &self.inner).finish()

Check warning on line 115 in src/exactly_one_err.rs

View check run for this annotation

Codecov / codecov/patch

src/exactly_one_err.rs#L115

Added line #L115 was not covered by tests
}
}

Expand Down