From 88c6469154889204e318f43edf387ea04b132eba Mon Sep 17 00:00:00 2001 From: Philipp Hofer Date: Mon, 11 Nov 2024 22:45:32 +0100 Subject: [PATCH] trim ergo entries --- src/tera/ergo.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tera/ergo.rs b/src/tera/ergo.rs index a029a7b..317f008 100644 --- a/src/tera/ergo.rs +++ b/src/tera/ergo.rs @@ -209,10 +209,12 @@ async fn new_thirty( if let Err(e) = data.proof.move_copy_to(file_path).await { eprintln!("Failed to persist file: {:?}", e); } + + let result = data.result.trim_start_matches(|c| c == '0' || c == ' '); sqlx::query!( "UPDATE user SET dirty_thirty = ? where id = ?", - data.result, + result, data.user ) .execute(db.inner()) @@ -253,10 +255,11 @@ async fn new_dozen( if let Err(e) = data.proof.move_copy_to(file_path).await { eprintln!("Failed to persist file: {:?}", e); } + let result = data.result.trim_start_matches(|c| c == '0' || c == ' '); sqlx::query!( "UPDATE user SET dirty_dozen = ? where id = ?", - data.result, + result, data.user ) .execute(db.inner())