From 441b7f5ad6cc6afbad34a68ce0a4e998b6b269d0 Mon Sep 17 00:00:00 2001 From: Artus Date: Mon, 15 Jul 2019 16:07:25 +0200 Subject: [PATCH] little fixes --- lootalot_db/src/lib.rs | 6 +++--- src/main.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lootalot_db/src/lib.rs b/lootalot_db/src/lib.rs index a03cd0b..f11d199 100644 --- a/lootalot_db/src/lib.rs +++ b/lootalot_db/src/lib.rs @@ -164,13 +164,13 @@ impl<'q> AsPlayer<'q> { .first::(self.conn)?; // TODO: improve this // should be move inside a WealthUpdate method - let update = models::Wealth::from_gp(current_wealth.to_gp() + value_in_gp); + let updated_wealth = models::Wealth::from_gp(current_wealth.to_gp() + value_in_gp); // Difference in coins that is sent back - let (old, new) = (current_wealth.as_tuple(), update.as_tuple()); + let (old, new) = (current_wealth.as_tuple(), updated_wealth.as_tuple()); let diff = (new.0 - old.0, new.1 - old.1, new.2 - old.2, new.3 - old.3); diesel::update(players) .filter(id.eq(self.id)) - .set(&update) + .set(&updated_wealth) .execute(self.conn) .map(|r| match r { 1 => ActionStatus { diff --git a/src/main.rs b/src/main.rs index 5e1ed9a..728aaa6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,5 +13,5 @@ fn main() { // Server is started with 'serve' subcommand // $ lootalot serve // Start the server. - server::serve(); + server::serve().ok(); }