diff options
Diffstat (limited to 'planetwars-server/src/db/matches.rs')
-rw-r--r-- | planetwars-server/src/db/matches.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/planetwars-server/src/db/matches.rs b/planetwars-server/src/db/matches.rs index ee25e85..dfff3cf 100644 --- a/planetwars-server/src/db/matches.rs +++ b/planetwars-server/src/db/matches.rs @@ -160,14 +160,17 @@ pub fn find_match_base(id: i32, conn: &PgConnection) -> QueryResult<MatchBase> { } pub enum MatchResult { - Finished { winner: Option<i32> } + Finished { winner: Option<i32> }, } pub fn save_match_result(id: i32, result: MatchResult, conn: &PgConnection) -> QueryResult<()> { let MatchResult::Finished { winner } = result; diesel::update(matches::table.find(id)) - .set((matches::winner.eq(winner), matches::state.eq(MatchState::Finished))) + .set(( + matches::winner.eq(winner), + matches::state.eq(MatchState::Finished), + )) .execute(conn)?; Ok(()) -}
\ No newline at end of file +} |