From e5a53678644c16b707a915de8836e99242f22b45 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 16 May 2025 07:44:37 -0700 Subject: [PATCH] [bitboard] Remove leading underscore from leading_zeros and trailing_zeros methods This is a clippy suggestion. --- bitboard/src/bitboard.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bitboard/src/bitboard.rs b/bitboard/src/bitboard.rs index 573dff5..bb6738c 100644 --- a/bitboard/src/bitboard.rs +++ b/bitboard/src/bitboard.rs @@ -258,7 +258,7 @@ impl BitBoard { /// the board is empty, returns `None`. #[must_use] pub fn first_occupied_square_leading(self) -> Option { - let leading_zeros = self._leading_zeros(); + let leading_zeros = self.leading_zeros(); if leading_zeros < SQUARES_NUM { unsafe { Some(Square::from_index_unchecked( @@ -275,7 +275,7 @@ impl BitBoard { /// If the board is empty, returns `None`. #[must_use] pub fn first_occupied_square_trailing(self) -> Option { - let trailing_zeros = self._trailing_zeros(); + let trailing_zeros = self.trailing_zeros(); if trailing_zeros < SQUARES_NUM { unsafe { Some(Square::from_index_unchecked(trailing_zeros)) } @@ -288,13 +288,13 @@ impl BitBoard { impl BitBoard { #[must_use] #[allow(clippy::cast_possible_truncation)] - fn _leading_zeros(self) -> u8 { + fn leading_zeros(self) -> u8 { self.0.leading_zeros() as u8 } #[must_use] #[allow(clippy::cast_possible_truncation)] - fn _trailing_zeros(self) -> u8 { + fn trailing_zeros(self) -> u8 { self.0.trailing_zeros() as u8 } } @@ -357,7 +357,7 @@ impl TryFrom for Square { return Err(TryFromBitBoardError::NotSingleSquare); } - unsafe { Ok(Square::from_index_unchecked(value._trailing_zeros())) } + unsafe { Ok(Square::from_index_unchecked(value.trailing_zeros())) } } }