From 746e3bf17463a377b6c54b291ebef9a736d6ceb7 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 25 Jan 2024 11:24:36 +0100 Subject: chore: autoformat code Use #[rustfmt:skip] to preserve aligned blocks --- src/bitboard.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/bitboard.rs') diff --git a/src/bitboard.rs b/src/bitboard.rs index 48a60d8..ab029bc 100644 --- a/src/bitboard.rs +++ b/src/bitboard.rs @@ -43,18 +43,12 @@ pub trait BitboardFns { fn nort_fill(self) -> Self; /// Return bitboard with a sout fill fn sout_fill(self) -> Self; - } const DE_BRUJIN_SEQUENCE: [u8; 64] = [ - 0, 1, 48, 2, 57, 49, 28, 3, - 61, 58, 50, 42, 38, 29, 17, 4, - 62, 55, 59, 36, 53, 51, 43, 22, - 45, 39, 33, 30, 24, 18, 12, 5, - 63, 47, 56, 27, 60, 41, 37, 16, - 54, 35, 52, 21, 44, 32, 23, 11, - 46, 26, 40, 15, 34, 20, 31, 10, - 25, 14, 19, 9, 13, 8, 7, 6 + 0, 1, 48, 2, 57, 49, 28, 3, 61, 58, 50, 42, 38, 29, 17, 4, 62, 55, 59, 36, 53, 51, 43, 22, 45, + 39, 33, 30, 24, 18, 12, 5, 63, 47, 56, 27, 60, 41, 37, 16, 54, 35, 52, 21, 44, 32, 23, 11, 46, + 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6, ]; static NOT_A_FILE: Bitboard = 0xFEFEFEFEFEFEFEFE; @@ -85,15 +79,13 @@ impl BitboardFns for Bitboard { count } - fn ls1b(self) -> Self { if self == 0 { - return 0 + return 0; } self & !(self - 1) } - fn bitscan(self) -> Square { // TODO: generate private De Brujin routine debug_assert!(self != 0, "Can not bitscan empty bitboard"); @@ -146,7 +138,7 @@ impl BitboardFns for Bitboard { } } -pub struct SquareIterator (Bitboard); +pub struct SquareIterator(Bitboard); impl Iterator for SquareIterator { type Item = Square; -- cgit v1.2.3