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

Just print out name string, not the entire Name struct #8494

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

Aceeri
Copy link
Member

@Aceeri Aceeri commented Apr 25, 2023

Objective

This is just an oversight on my part when I implemented this in #7186, there isn't much reason to print out the hash of a Name like it does currently:

Name { hash: 1608798714325729304, name: "Suzanne" } (7v0)

Solution

Instead it would be better if we just printed out the string like so:

"Suzanne" (7v0)

As it conveys all of the information in a less cluttered and immediately intuitive way which was the original purpose of DebugName. Which I also think translates to Name as well since I mostly see it as a thin wrapper around a string.

@Aceeri Aceeri added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Apr 25, 2023
@Aceeri
Copy link
Member Author

Aceeri commented Apr 25, 2023

Some thoughts after thinking through this again: Should we even be printing out the hash for Name? In some ways I feel like it might make sense to just forward the Debug impl to the string. The hash value isn't exactly super useful for users and just clutters the debug info, unless I'm missing someething important about it.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Apr 25, 2023
Copy link
Member

@MrGVSV MrGVSV left a comment

Choose a reason for hiding this comment

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

This will make things look a lot nicer when debugging 😄

Just one comment but non-blocking.

crates/bevy_core/src/name.rs Show resolved Hide resolved
@cart cart enabled auto-merge April 26, 2023 19:47
@cart cart added this pull request to the merge queue Apr 26, 2023
Merged via the queue into bevyengine:main with commit c324b90 Apr 26, 2023
@Aceeri Aceeri deleted the debug-name-fix branch May 4, 2023 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants