rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.69k stars 303 forks source link

`ExactlyOneError`: prettier Debug implementation #861

Closed Philippe-Cholet closed 7 months ago

Philippe-Cholet commented 7 months ago

It could be derived. It was, and it apparently was decided not to in #484, probably to not leak implementation details that could confuse the user. However, it would not render well for pretty formats such as "{:#?}". I think we should call methods on f instead of using write!. Then it can be both pretty and helpful to the user.

codecov[bot] commented 7 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (62d2b65) 93.43% compared to head (b31596f) 93.48%.

Files Patch % Lines
src/exactly_one_err.rs 0.00% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #861 +/- ## ========================================== + Coverage 93.43% 93.48% +0.05% ========================================== Files 48 48 Lines 6778 6774 -4 ========================================== Hits 6333 6333 + Misses 445 441 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.