diff --git a/bitboard/src/bitboard.rs b/bitboard/src/bitboard.rs index d025038..7dcc164 100644 --- a/bitboard/src/bitboard.rs +++ b/bitboard/src/bitboard.rs @@ -70,7 +70,7 @@ impl BitBoard { } #[must_use] - pub fn ray(sq: Square, dir: Direction) -> &'static BitBoard { + pub fn ray(sq: Square, dir: Direction) -> BitBoard { library::library().ray(sq, dir) } diff --git a/bitboard/src/library.rs b/bitboard/src/library.rs index 419f6e2..177b6b7 100644 --- a/bitboard/src/library.rs +++ b/bitboard/src/library.rs @@ -237,8 +237,8 @@ impl MoveLibrary { ray } - pub(super) const fn ray(&self, sq: Square, dir: Direction) -> &BitBoard { - &self.rays[sq as usize][dir as usize] + pub(super) const fn ray(&self, sq: Square, dir: Direction) -> BitBoard { + self.rays[sq as usize][dir as usize] } pub(super) const fn pawn_pushes(&self, sq: Square, color: Color) -> BitBoard {