aboutsummaryrefslogtreecommitdiff
path: root/planetwars-server/src/db/matches.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-06-20 22:01:26 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-06-20 22:01:26 +0200
commit951cb293111db9ea0947cd65872da744bce92d31 (patch)
treed232f6c1443b96b24d821fdf05b1d96037091c30 /planetwars-server/src/db/matches.rs
parenta2a8a41689ad07eb2236ee438e9d01266946008d (diff)
downloadplanetwars.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.rs9
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
+}