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

Loosen trait bound for pretty printing #88

Conversation

lo48576
Copy link
Contributor

@lo48576 lo48576 commented Sep 2, 2022

NodeId::debug_pretty_print() introduced by #87 requires T: Debug, but it should not be checked there since the value types such that T: !Debug + Display are also supported.
It is safe to remove the trait bound here since impl<T: {Debug, Display}> {Debug, Display} for DebugPrettyPrint<'_, T> requires necessary trait to be implemented.

This patch removes unnecessary trait bound from NodeId::debug_pretty_print().

@codecov
Copy link

codecov bot commented Sep 2, 2022

Codecov Report

Merging #88 (d8d64c3) into main (7dd4eab) will not change coverage.
The diff coverage is n/a.

@@          Coverage Diff          @@
##            main     #88   +/-   ##
=====================================
  Coverage   62.5%   62.5%           
=====================================
  Files          8       8           
  Lines        470     470           
  Branches     149     149           
=====================================
  Hits         294     294           
  Misses        52      52           
  Partials     124     124           

The value type is required to implement `Debug` OR `Display` to be
pretty-printed. Those trait bounds are checked on pretty-printing,
so `T: Debug` should not be enforced when creating a proxy object.
@lo48576 lo48576 force-pushed the feature/loosen-pretty-print-trait-bound branch from 891893c to d8d64c3 Compare September 2, 2022 14:27
Copy link
Owner

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@saschagrunert saschagrunert merged commit 5b7edb9 into saschagrunert:main Sep 2, 2022
@lo48576 lo48576 deleted the feature/loosen-pretty-print-trait-bound branch September 2, 2022 14:48
@lo48576 lo48576 restored the feature/loosen-pretty-print-trait-bound branch September 22, 2022 04:07
@lo48576 lo48576 deleted the feature/loosen-pretty-print-trait-bound branch September 22, 2022 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants