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

Don't show .to_bits in Display impl for Entity #14011

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

alice-i-cecile
Copy link
Member

Objective

#12469 changed the Debug impl for Entity, making sure it's actually accurate for debugging. To ensure that its can still be readily logged in error messages and inspectors, this PR added a more concise and human-friendly Display impl.

However, users found this form too verbose: the to_bits information was unhelpful and too long. Fixes #13980.

Solution

  • Don't include Entity::to_bits in the Display implementation for Entity. This information can readily be accessed and logged for users who need it.
  • Also clean up the implementation of Display for DebugName, introduced in Add Display implementation to DebugName. #13760, to simply use the new Display impl (since this was the desired format there).

Testing

I've updated an existing test to verify the output of Entity::display.

@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jun 25, 2024
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Jun 25, 2024
crates/bevy_ecs/src/entity/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: Kristoffer Søholm <[email protected]>
@alice-i-cecile
Copy link
Member Author

@eidloi could I get your review here?

Copy link
Contributor

@viridia viridia left a comment

Choose a reason for hiding this comment

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

I ran into this recently as well.

@eidloi
Copy link

eidloi commented Jun 25, 2024

Exactly what I needed thanks!

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 25, 2024
@alice-i-cecile
Copy link
Member Author

Thanks y'all!

Merged via the queue into bevyengine:main with commit 52e5ad5 Jun 25, 2024
27 checks passed
mockersf pushed a commit that referenced this pull request Jun 25, 2024
accurate for debugging. To ensure that its can still be readily logged
in error messages and inspectors, this PR added a more concise and
human-friendly `Display` impl.

However, users found this form too verbose: the `to_bits` information
was unhelpful and too long. Fixes #13980.

- Don't include `Entity::to_bits` in the `Display` implementation for
`Entity`. This information can readily be accessed and logged for users
who need it.
- Also clean up the implementation of `Display` for `DebugName`,
introduced in #13760, to simply
use the new `Display` impl (since this was the desired format there).

I've updated an existing test to verify the output of `Entity::display`.

---------

Co-authored-by: Kristoffer Søholm <[email protected]>
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-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression on string representation of entities
4 participants