Skip to content

Commit

Permalink
Merge pull request #65 from johanhelsing/gamestatecell-debug
Browse files Browse the repository at this point in the history
Implement `Debug` for `GameStateCell`
  • Loading branch information
gschup authored Oct 23, 2023
2 parents 5c6a0e0 + 8ae279d commit d4148f8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sync_layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ impl<T: Clone> Clone for GameStateCell<T> {
}
}

impl<T: Clone> std::fmt::Debug for GameStateCell<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let inner = self.0.lock();
f.debug_struct("GameStateCell")
.field("frame", &inner.frame)
.field("checksum", &inner.checksum)
.finish_non_exhaustive()
}
}

#[derive(Clone)]
pub(crate) struct SavedStates<T: Clone> {
pub states: Vec<GameStateCell<T>>,
Expand Down

0 comments on commit d4148f8

Please sign in to comment.