Skip to content

Commit

Permalink
Don't debug SystemId's entity field twice (#14499)
Browse files Browse the repository at this point in the history
# Objective

- `SystemId`'s `Debug` implementation includes its `entity` field twice.
- This was likely an oversight in #11019, since before that PR the
second field was the `PhantomData` one.

## Solution

- Only include it once

Alternatively, this could be changed to match the struct representation
of `SystemId`, thus instructing the formatter to print a named struct
and including the `PhantomData` field.
  • Loading branch information
SkiFire13 authored Jul 27, 2024
1 parent 4f5b8ca commit bc80b95
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/bevy_ecs/src/system/system_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ impl<I, O> std::hash::Hash for SystemId<I, O> {

impl<I, O> std::fmt::Debug for SystemId<I, O> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple("SystemId")
.field(&self.entity)
.field(&self.entity)
.finish()
f.debug_tuple("SystemId").field(&self.entity).finish()
}
}

Expand Down

0 comments on commit bc80b95

Please sign in to comment.