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()] {
 | 
					        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 } => {
 | 
					            Player::Engine { elo } => {
 | 
				
			||||||
                if self.is_uciok() {
 | 
					                if self.is_uciok() {
 | 
				
			||||||
                    if let Some(elo) = elo {
 | 
					                    if let Some(elo) = elo {
 | 
				
			||||||
@ -367,17 +367,14 @@ impl<Fi: Read, Fo: Write> UciEngine<Fi, Fo> {
 | 
				
			|||||||
                        btime,
 | 
					                        btime,
 | 
				
			||||||
                        bincr,
 | 
					                        bincr,
 | 
				
			||||||
                    });
 | 
					                    });
 | 
				
			||||||
 | 
					 | 
				
			||||||
                    Ok(())
 | 
					 | 
				
			||||||
                } else {
 | 
					                } 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);
 | 
					        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() {
 | 
					        Some("bestmove") => match message_iter.collect::<Vec<&str>>().as_slice() {
 | 
				
			||||||
            [] => Err("Empty bestmove command"),
 | 
					            [] => Err("Empty bestmove command"),
 | 
				
			||||||
            [chessmove] => Ok(EngineCommand::BestMove {
 | 
					            [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: None,
 | 
				
			||||||
            }),
 | 
					            }),
 | 
				
			||||||
            [_, "ponder"] => Err("Empty ponder in bestmove command"),
 | 
					            [_, "ponder"] => Err("Empty ponder in bestmove command"),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user