Skip to content

Commit

Permalink
chore: fix a bunch of doc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
raklaptudirm committed May 25, 2024
1 parent 8aae4db commit e9f9c06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
13 changes: 7 additions & 6 deletions ataxx/src/move.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ impl FromStr for Move {
type Err = MoveParseError;

/// from_str converts the given string representation of a Move into a [Move].
/// The formats supported are '0000' for a [Move::PASS], <target> for a singular
/// Move, and <source><target> for a jump Move. For how <source> and <target>
/// are parsed, take a look at [`Square::FromStr`](Square::from_str). This
/// function can be treated as the inverse of [`Move::Display`].
/// The formats supported are '0000' for a [Move::PASS], `<target>` for a
/// singular Move, and `<source><target>` for a jump Move. For how `<source>`
/// and `<target>` are parsed, take a look at
/// [`Square::FromStr`](Square::from_str). This function can be treated as the
/// inverse of the [`fmt::Display`] trait for [Move].
/// ```
/// use ataxx::*;
/// use std::str::FromStr;
Expand Down Expand Up @@ -239,8 +240,8 @@ impl fmt::Debug for Move {

/// MoveStore is a trait implemented by types which are able to store [Move]s inside
/// themselves and are thus usable in move-generation methods in
/// [Board](super::Board) like
/// [`Board::generate_moves_into<T>`](super::Board::generate_moves_into<T>).
/// [Position](super::Position) like
/// [`Position::generate_moves_into<T>`](super::Position::generate_moves_into<T>).
pub trait MoveStore {
/// push adds the given Move to the MoveStore.
fn push(&mut self, m: Move);
Expand Down
7 changes: 4 additions & 3 deletions ataxx/src/position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ use crate::{
PieceParseError,
};

/// Position represents the snapshot of an Ataxx Board, the state of the Board
/// at a single point in time. It is the functional backend of the [Board] type.
/// Position represents the snapshot of an Ataxx Board, the state of the an
/// ataxx game at a single point in time. It also provides all of the methods
/// necessary to manipulate such a snapshot.
#[derive(Copy, Clone)]
pub struct Position {
/// bitboards stores [BitBoard]s for the piece configuration of each [Piece].
Expand Down Expand Up @@ -162,7 +163,7 @@ impl Position {
}

/// winner returns the Piece which has won the game. It returns [`Piece::None`]
/// if the game is a draw. If [`Board::is_game_over`] is false, then the
/// if the game is a draw. If [`Position::is_game_over`] is false, then the
/// behavior of this function is undefined.
/// ```
/// use ataxx::*;
Expand Down

0 comments on commit e9f9c06

Please sign in to comment.