diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-06-20 22:01:26 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-06-20 22:01:26 +0200 |
commit | 951cb293111db9ea0947cd65872da744bce92d31 (patch) | |
tree | d232f6c1443b96b24d821fdf05b1d96037091c30 /planetwars-server/src/db/matches.rs | |
parent | a2a8a41689ad07eb2236ee438e9d01266946008d (diff) | |
download | planetwars.dev-951cb293111db9ea0947cd65872da744bce92d31.tar.xz planetwars.dev-951cb293111db9ea0947cd65872da744bce92d31.zip |
upgrade to axum 0.5
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 +} |