remove unnecessary Result function return value
This commit is contained in:
parent
26a15985a8
commit
da6060cf37
|
@ -346,9 +346,9 @@ impl<Fi: Read, Fo: Write> UciEngine<Fi, Fo> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn go(&mut self) -> Result<(), &'static str> {
|
||||
pub fn go(&mut self) {
|
||||
match self.player[self.side_to_move().to_index()] {
|
||||
Player::Human { .. } => Err("Not a machine to play for current color."),
|
||||
Player::Human { .. } => warn!("Not a machine to play for current color."),
|
||||
Player::Engine { elo } => {
|
||||
if self.is_uciok() {
|
||||
if let Some(elo) = elo {
|
||||
|
@ -367,17 +367,14 @@ impl<Fi: Read, Fo: Write> UciEngine<Fi, Fo> {
|
|||
btime,
|
||||
bincr,
|
||||
});
|
||||
|
||||
Ok(())
|
||||
} else {
|
||||
Err("UCI engine not ready")
|
||||
warn!("UCI engine not ready")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn stop(&mut self) -> Result<(), &'static str> {
|
||||
pub fn stop(&mut self) {
|
||||
self.push(GuiCommand::Stop);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ pub fn parse(message: &mut str) -> Result<EngineCommand, &'static str> {
|
|||
Some("bestmove") => match message_iter.collect::<Vec<&str>>().as_slice() {
|
||||
[] => Err("Empty bestmove command"),
|
||||
[chessmove] => Ok(EngineCommand::BestMove {
|
||||
best_move: ChessMove::from_str(chessmove).expect("chessmove is invalid"),
|
||||
best_move: ChessMove::from_str(chessmove).expect(&format!("chessmove {:?} is invalid", chessmove)),
|
||||
ponder: None,
|
||||
}),
|
||||
[_, "ponder"] => Err("Empty ponder in bestmove command"),
|
||||
|
|
Loading…
Reference in New Issue