From d33d75870bb2df2d8a3b4c675ed28eb51fc3bf8d Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Sun, 17 May 2026 10:07:43 -0700 Subject: [PATCH] no need to construct stats --- card_game/src/lib.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/card_game/src/lib.rs b/card_game/src/lib.rs index 5981f2f..c556506 100644 --- a/card_game/src/lib.rs +++ b/card_game/src/lib.rs @@ -238,18 +238,12 @@ pub enum SessionInstruction { InnerInstruction(I), } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct SessionStats { inner_stats: S, undos: usize, } impl SessionStats { - const fn new(inner_stats: S) -> Self { - SessionStats { - inner_stats, - undos: 0, - } - } pub const fn stats(&self) -> &S { &self.inner_stats } @@ -287,9 +281,9 @@ where G::Stats: Clone + Default, G::Instruction: Clone + Eq + core::hash::Hash, { - pub fn new(state: G, stats: G::Stats, config: G::Config) -> Self { + pub fn new(state: G, config: G::Config) -> Self { Self { - stats: SessionStats::new(stats), + stats: SessionStats::default(), config, state: SessionState::new(state), } @@ -298,7 +292,7 @@ where where G::Config: Default, { - Self::new(state, Default::default(), Default::default()) + Self::new(state, Default::default()) } pub const fn stats(&self) -> &SessionStats { &self.stats