must_use
This commit is contained in:
parent
01253b66de
commit
457e0c5aff
2 changed files with 4 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ use std::iter::ExactSizeIterator;
|
|||
use std::iter::FusedIterator;
|
||||
|
||||
/// A legal move.
|
||||
#[must_use]
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct Move<'l> {
|
||||
position: &'l Position,
|
||||
|
|
@ -199,6 +200,7 @@ impl<'l> Move<'l> {
|
|||
///
|
||||
/// It can be obtained using the [`Position::legal_moves`] method. This type is an iterator over
|
||||
/// [`Move`] objects.
|
||||
#[must_use]
|
||||
pub struct Moves<'l> {
|
||||
position: &'l Position,
|
||||
is_check: bool,
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ use std::iter::FusedIterator;
|
|||
/// The order on [`Position`] is defined only for use in data structures. Hence its only
|
||||
/// requirement is to be efficient while respecting the [`Ord`] trait protocol. It should not be
|
||||
/// considered stable.
|
||||
#[must_use]
|
||||
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
|
||||
pub struct Position(Setup);
|
||||
|
||||
|
|
@ -91,6 +92,7 @@ impl Position {
|
|||
/// position.legal_moves().len()
|
||||
/// # };
|
||||
/// ```
|
||||
#[must_use]
|
||||
#[inline]
|
||||
pub fn count_legal_moves(&self) -> usize {
|
||||
struct MoveGenImpl {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue