From 9a8380573b110fe1abbe77f832c4a77ecd7d057b Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Mon, 22 Jan 2024 08:18:19 -0800 Subject: [PATCH] [board] Move MakeMoveBuilder::new() to an impl that specifies NoMove I can build these now without having to specify a type for M. --- board/src/position/builders/move_builder.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/board/src/position/builders/move_builder.rs b/board/src/position/builders/move_builder.rs index d27e373..5d12b19 100644 --- a/board/src/position/builders/move_builder.rs +++ b/board/src/position/builders/move_builder.rs @@ -41,17 +41,19 @@ pub enum ValidatedMove { impl MoveToMake for NoMove {} impl MoveToMake for ValidatedMove {} -impl<'p, M> Builder<'p, M> -where - M: MoveToMake, -{ +impl<'p> Builder<'p, NoMove> { pub fn new(position: &'p Position) -> Builder<'p, NoMove> { Builder { position, move_to_make: NoMove, } } +} +impl<'p, M> Builder<'p, M> +where + M: MoveToMake, +{ pub fn make(self, mv: &Move) -> Result, MakeMoveError> { let from_square = mv.from_square();