simplify FutureMoves::move_history
This commit is contained in:
parent
9fff000746
commit
693b5c1f7c
@ -331,7 +331,7 @@ impl FutureMoves {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn move_history(&self, idx: usize) -> Option<Vec<(MoveCoord, Piece)>> {
|
fn move_history(&self, idx: usize) -> Option<Vec<(MoveCoord, Piece)>> {
|
||||||
if let Some(root) = self.current_root {
|
self.current_root.and_then(|root| {
|
||||||
let mut hist = Vec::new();
|
let mut hist = Vec::new();
|
||||||
|
|
||||||
let mut current = Some(idx);
|
let mut current = Some(idx);
|
||||||
@ -351,9 +351,7 @@ impl FutureMoves {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Some(hist)
|
Some(hist)
|
||||||
} else {
|
})
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_board_from_idx(&self, idx: usize) -> Option<Board> {
|
fn get_board_from_idx(&self, idx: usize) -> Option<Board> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user