-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
π§βπ» zv, zn: Improve Str, Owned*Name, BusName Debug impls #450
Conversation
This makes Debug impls of Str transparent Before: Str(Static("foo")) After: "foo"
@SeaDve Many thanks! Before I look into the actual commits, could you please summarize what's the different with #394?
Looking nice! should we maybe not split it over multiple lines anymore? I think it was only needed when the format was too verbose and hard to follow. |
From user side, instead of making everything look like a string when printing its debug representation, it still retain the wrapper info, e.g., MemberName("foo"), WellKnownName("foo") etc. On the similarities with #394, this also removed the information that it is Owned or Borrowed, etc., i.e., Str(Borrowed("foo")) is just "foo". Owned*Name("foo") is just *Name("foo"). I think the commit messages summarizes it pretty well.
It is up to the formatter. I currently just copied the output from the dbg! macro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise. Thanks for writing good commit messages.
I am not sure how to handle this on |
This makes Debug impls of Owned*Name transparent Before: Owned*Name(*Name("foo")) After: Owned*Name("foo")
In case of |
That would make it inconsistent with |
Right. Then I am confused what the problem is? π€ If |
BusName is currently I also think the well-known/unique distinction is pretty useful. I wonder if we can do |
ah ok, yeah I see the issue.
Hmm.. why not? I'd say go for that. |
Sure. However, I will update the PR tomorrow morning as I am currently in bed |
For sure, it's nothing urgent. :) |
This makes Debug impl of BusName transparent Before: Unique(UniqueName("foo")) After: BusName::Unique("foo")
I have push the modifications, and also updated the PR comment on how debug prints look |
@SeaDve Many thanks for your efforts here! |
This PR reduces Debug impls verbosity but retains possibly useful information.
See also #394
Before:
After:
Fixes #431.