From 711f447993b25a80f9e21fbf6800c8bd5e6c44a8 Mon Sep 17 00:00:00 2001 From: Rhys Lloyd Date: Fri, 15 May 2026 08:07:55 -0700 Subject: [PATCH] fix trait --- src/card_game.rs | 4 ++-- src/klondike.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/card_game.rs b/src/card_game.rs index e9c309f..249144f 100644 --- a/src/card_game.rs +++ b/src/card_game.rs @@ -3,7 +3,7 @@ use crate::Rng; // TODO: pub struct ValidInstruction(I); pub trait Game { type Instruction; - fn possible_instructions(&self) -> impl Iterator; + fn possible_instructions(&self) -> impl Iterator + use; 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 { + fn possible_instructions(&self) -> impl Iterator + use { self.state.possible_instructions() } fn validate_instruction(&self, instruction: Self::Instruction) -> bool { diff --git a/src/klondike.rs b/src/klondike.rs index d0e9eb1..b46e9ee 100644 --- a/src/klondike.rs +++ b/src/klondike.rs @@ -82,7 +82,7 @@ impl Klondike { } impl Game for Klondike { type Instruction = KlondikeInstruction; - fn possible_instructions(&self) -> impl Iterator { + fn possible_instructions(&self) -> impl Iterator + use<> { vec![].into_iter() } fn validate_instruction(&self, instruction: Self::Instruction) -> bool {