api/gameserv: type email ExpiryTarget and chess Ending as enums (drop stringly returns)
All checks were successful
CI / check (push) Successful in 3m53s

This commit is contained in:
Jean Chevronnet 2026-07-17 14:15:39 +00:00
parent 2cdc7f820a
commit f5c976eb56
No known key found for this signature in database
4 changed files with 43 additions and 20 deletions

View file

@ -289,11 +289,10 @@ pub fn terminal(g: &Game) -> Option<Outcome> {
}
full_or_ongoing(b)
}
Board::Chess(st) => match chess::over(st).as_str() {
"w" => Some(Outcome::Win(Side::A)),
"b" => Some(Outcome::Win(Side::B)),
"draw" => Some(Outcome::Draw),
_ => None,
Board::Chess(st) => match chess::over(st) {
None => None,
Some(chess::Ending::Draw) => Some(Outcome::Draw),
Some(chess::Ending::Checkmate(c)) => Some(Outcome::Win(if c == b'w' { Side::A } else { Side::B })),
},
}
}