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

Align dbg!() and line!() output #58647

Closed
ranxiverba opened this issue Feb 22, 2019 · 2 comments
Closed

Align dbg!() and line!() output #58647

ranxiverba opened this issue Feb 22, 2019 · 2 comments
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@ranxiverba
Copy link

Hello.

Please, consider this issue as a minor.

Output of dbg!() macro will be better if it will align source code line number. I found that line!() macro does it. I think it would be nice if this macro always emit 4 chars, because most source code files has less than 10k lines. Consider the example:

[some/main.rs:84] hex::encode(dst.as_ref()) = "686aca464489"
[some/main.rs:126] hex::encode(src.as_ref()) = "f8c91afe015f"

I guess this will be better:

[some/main.rs:  84] hex::encode(dst.as_ref()) = "686aca464489"
[some/main.rs: 126] hex::encode(src.as_ref()) = "f8c91afe015f"

or

[some/main.rs:0084] hex::encode(dst.as_ref()) = "686aca464489"
[some/main.rs:0126] hex::encode(src.as_ref()) = "f8c91afe015f"

Thank you.

@Centril Centril added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Feb 22, 2019
@Centril
Copy link
Contributor

Centril commented Feb 22, 2019

If we're going to pick between those two new formats I'd go with the latter since it doesn't feel "empty". However, I'm not sure that the common case would benefit from a change.

@alexcrichton
Copy link
Member

Closing in accordance with the same action as #58753, and the PR has some more information as to why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants