From f8925f18db177b9a979f49d2ef85b4f81d142e00 Mon Sep 17 00:00:00 2001 From: cscherrNT Date: Thu, 21 Mar 2024 10:24:26 +0000 Subject: [PATCH] automatic cargo CI changes --- src/game/mod.rs | 21 +++++++++++---------- src/solvers/mod.rs | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/game/mod.rs b/src/game/mod.rs index 0226c0d..aca423e 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -4,7 +4,7 @@ pub struct Game { precompute: bool, max_steps: usize, step: usize, - solution: String + solution: String, } impl Game { @@ -24,14 +24,15 @@ impl Game { /// # Errors /// /// This function will return an error if . - pub(crate) fn build(length: usize, precompute: bool, max_steps: usize) -> anyhow::Result<(Self)> { - let mut game = Game { - length, precompute, max_steps, + pub(crate) fn build(length: usize, precompute: bool, max_steps: usize) -> anyhow::Result { + let _game = Game { + length, + precompute, + max_steps, step: 0, - solution: String::default() // we actually set this later + solution: String::default(), // we actually set this later }; - // TODO: load wordlist of possible answers // TODO: select one as a solution at random // NOTE: The possible answers should be determined with a wordlist that has the @@ -47,14 +48,14 @@ impl Game { pub struct GameBuilder { length: usize, precompute: bool, - max_steps: usize + max_steps: usize, } impl GameBuilder { /// build a [`Game`] with the stored configuration pub fn build(self) -> anyhow::Result { - let game: Game = Game::build(self.length, self.precompute, self.max_steps)?; - Ok(game) + let game: Game = Game::build(self.length, self.precompute, self.max_steps)?; + Ok(game) } /// Sets the precompute of this [`GameBuilder`]. @@ -75,7 +76,7 @@ impl Default for GameBuilder { Self { length: super::DEFAULT_WORD_LENGTH, precompute: false, - max_steps: super::DEFAULT_MAX_STEPS + max_steps: super::DEFAULT_MAX_STEPS, } } } diff --git a/src/solvers/mod.rs b/src/solvers/mod.rs index e69de29..8b13789 100644 --- a/src/solvers/mod.rs +++ b/src/solvers/mod.rs @@ -0,0 +1 @@ +