fix trait

This commit is contained in:
2026-05-15 08:07:55 -07:00
parent 25d3c3aae4
commit 711f447993
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ use crate::Rng;
// TODO: pub struct ValidInstruction<I>(I);
pub trait Game {
type Instruction;
fn possible_instructions(&self) -> impl Iterator<Item = Self::Instruction>;
fn possible_instructions(&self) -> impl Iterator<Item = Self::Instruction> + use<Self>;
fn validate_instruction(&self, instruction: Self::Instruction) -> bool;
fn process_instruction(&mut self, instruction: Self::Instruction);
fn is_win(&self) -> bool;
@@ -189,7 +189,7 @@ where
G::Instruction: Clone,
{
type Instruction = G::Instruction;
fn possible_instructions(&self) -> impl Iterator<Item = Self::Instruction> {
fn possible_instructions(&self) -> impl Iterator<Item = Self::Instruction> + use<G> {
self.state.possible_instructions()
}
fn validate_instruction(&self, instruction: Self::Instruction) -> bool {
+1 -1
View File
@@ -82,7 +82,7 @@ impl Klondike {
}
impl Game for Klondike {
type Instruction = KlondikeInstruction;
fn possible_instructions(&self) -> impl Iterator<Item = Self::Instruction> {
fn possible_instructions(&self) -> impl Iterator<Item = Self::Instruction> + use<> {
vec![].into_iter()
}
fn validate_instruction(&self, instruction: Self::Instruction) -> bool {