From 30088f228a726f9930f1d606f6aa41c8562b8f81 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 28 Jan 2025 13:16:30 -0500 Subject: [PATCH] impl std::ops::Not for Piece --- src/repr.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/repr.rs b/src/repr.rs index 985d770..731fb9e 100644 --- a/src/repr.rs +++ b/src/repr.rs @@ -23,6 +23,14 @@ impl Piece { } } +impl std::ops::Not for Piece { + type Output = Piece; + + fn not(self) -> Self::Output { + self.flip() + } +} + const BOARD_SIZE: usize = 8; #[derive(Copy, Clone)]