1
0
Fork 0

impl Clone for Moves<'l>

This commit is contained in:
Paul-Nicolas Madelaine 2025-11-26 23:03:23 +01:00
parent 270ac66db4
commit 5d2129b797
2 changed files with 15 additions and 0 deletions

View file

@ -7,6 +7,19 @@ pub(crate) struct ArrayVec<T, const N: usize> {
array: [MaybeUninit<T>; N],
}
impl<T, const N: usize> Clone for ArrayVec<T, N>
where
T: Copy,
{
#[inline]
fn clone(&self) -> Self {
Self {
len: self.len,
array: self.array.clone(),
}
}
}
impl<T, const N: usize> ArrayVec<T, N> {
#[inline]
pub(crate) fn new() -> Self {

View file

@ -208,6 +208,7 @@ impl<'l> Move<'l> {
/// Even though the [`Position`] type can represent more positions than just reachable positions,
/// the proof still holds, as its definition of a position is even less restrictive.
#[must_use]
#[derive(Clone)]
pub struct Moves<'l> {
position: &'l Position,
is_check: bool,
@ -345,6 +346,7 @@ impl<'l> Moves<'l> {
}
/// An iterator over legal moves.
#[derive(Clone)]
pub struct MovesIter<'l> {
position: &'l Position,
iter: core::slice::Iter<'l, RawMove>,