no_std
This commit is contained in:
parent
c0e915f1b4
commit
00261d95c1
9 changed files with 102 additions and 96 deletions
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
use crate::board::*;
|
||||
|
||||
use std::iter::ExactSizeIterator;
|
||||
use std::iter::FusedIterator;
|
||||
use core::iter::ExactSizeIterator;
|
||||
use core::iter::FusedIterator;
|
||||
|
||||
/// A set of squares.
|
||||
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
|
@ -87,46 +87,46 @@ impl Bitboard {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::ops::BitOr for Bitboard {
|
||||
impl core::ops::BitOr for Bitboard {
|
||||
type Output = Self;
|
||||
#[inline]
|
||||
fn bitor(self, rhs: Self) -> Self::Output {
|
||||
Self(self.0 | rhs.0)
|
||||
}
|
||||
}
|
||||
impl std::ops::BitAnd for Bitboard {
|
||||
impl core::ops::BitAnd for Bitboard {
|
||||
type Output = Self;
|
||||
#[inline]
|
||||
fn bitand(self, rhs: Self) -> Self::Output {
|
||||
Self(self.0 & rhs.0)
|
||||
}
|
||||
}
|
||||
impl std::ops::BitXor for Bitboard {
|
||||
impl core::ops::BitXor for Bitboard {
|
||||
type Output = Self;
|
||||
#[inline]
|
||||
fn bitxor(self, rhs: Self) -> Self::Output {
|
||||
Self(self.0 ^ rhs.0)
|
||||
}
|
||||
}
|
||||
impl std::ops::BitOrAssign for Bitboard {
|
||||
impl core::ops::BitOrAssign for Bitboard {
|
||||
#[inline]
|
||||
fn bitor_assign(&mut self, rhs: Self) {
|
||||
self.0 |= rhs.0;
|
||||
}
|
||||
}
|
||||
impl std::ops::BitAndAssign for Bitboard {
|
||||
impl core::ops::BitAndAssign for Bitboard {
|
||||
#[inline]
|
||||
fn bitand_assign(&mut self, rhs: Self) {
|
||||
self.0 &= rhs.0;
|
||||
}
|
||||
}
|
||||
impl std::ops::BitXorAssign for Bitboard {
|
||||
impl core::ops::BitXorAssign for Bitboard {
|
||||
#[inline]
|
||||
fn bitxor_assign(&mut self, rhs: Self) {
|
||||
self.0 ^= rhs.0;
|
||||
}
|
||||
}
|
||||
impl std::ops::Not for Bitboard {
|
||||
impl core::ops::Not for Bitboard {
|
||||
type Output = Self;
|
||||
#[inline]
|
||||
fn not(self) -> Self::Output {
|
||||
|
|
@ -182,8 +182,8 @@ impl ExactSizeIterator for Bitboard {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Bitboard {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
impl core::fmt::Debug for Bitboard {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
write!(f, "Bitboard(0x{:016X})", self.0)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue