From e8b5c9f73c9d9b9fe296dd6510e45c7a1a1104a8 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 17 Jul 2022 21:30:23 +0200 Subject: [PATCH] Use 'Square::index' in 'Square::{file,rank}_index' --- src/board/square.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/board/square.rs b/src/board/square.rs index 7f1c822..437d2e6 100644 --- a/src/board/square.rs +++ b/src/board/square.rs @@ -69,13 +69,13 @@ impl Square { /// Return the index of the rank of this square (0 -> rank 1, ..., 7 -> rank 8). #[inline(always)] pub fn rank_index(self) -> usize { - (self as usize) % 8 + self.index() % 8 } /// Return the index of the rank of this square (0 -> file A, ..., 7 -> file H). #[inline(always)] pub fn file_index(self) -> usize { - (self as usize) / 8 + self.index() / 8 } /// Return a [Rank] representing the rank of this square.