trim-ergo #795

Merged
philipp merged 3 commits from trim-ergo into staging 2024-11-11 23:00:10 +01:00
Showing only changes of commit 88c6469154 - Show all commits

View File

@ -209,10 +209,12 @@ async fn new_thirty(
if let Err(e) = data.proof.move_copy_to(file_path).await { if let Err(e) = data.proof.move_copy_to(file_path).await {
eprintln!("Failed to persist file: {:?}", e); eprintln!("Failed to persist file: {:?}", e);
} }
let result = data.result.trim_start_matches(|c| c == '0' || c == ' ');
sqlx::query!( sqlx::query!(
"UPDATE user SET dirty_thirty = ? where id = ?", "UPDATE user SET dirty_thirty = ? where id = ?",
data.result, result,
data.user data.user
) )
.execute(db.inner()) .execute(db.inner())
@ -253,10 +255,11 @@ async fn new_dozen(
if let Err(e) = data.proof.move_copy_to(file_path).await { if let Err(e) = data.proof.move_copy_to(file_path).await {
eprintln!("Failed to persist file: {:?}", e); eprintln!("Failed to persist file: {:?}", e);
} }
let result = data.result.trim_start_matches(|c| c == '0' || c == ' ');
sqlx::query!( sqlx::query!(
"UPDATE user SET dirty_dozen = ? where id = ?", "UPDATE user SET dirty_dozen = ? where id = ?",
data.result, result,
data.user data.user
) )
.execute(db.inner()) .execute(db.inner())