From 1b750c2cc04b7080ea7913070c24b5a237a11d0e Mon Sep 17 00:00:00 2001 From: ArloFilley Date: Mon, 31 Oct 2022 23:18:57 +0000 Subject: [PATCH] changed certain datatypes for more sensible datatypes --- src/main.rs | 10 +++++----- src/sql.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4a39804..8c68be1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,13 +14,13 @@ fn test() -> String { #[serde(crate = "rocket::serde")] struct PostTest<'r> { test_type: &'r str, - test_length: i64, - test_time: i32, + test_length: u32, + test_time: u32, test_seed: i64, quote_id: i32, - wpm: i16, - accuracy: i8, - user_id: i32 + wpm: u8, + accuracy: u8, + user_id: u32 } #[post("/post_test", data = "")] diff --git a/src/sql.rs b/src/sql.rs index 8a3533a..05b0968 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -26,7 +26,7 @@ pub fn create_database() -> Result<()> { Ok(()) } -pub fn post_test(test_type: &str, test_length: i64, test_time: i32, test_seed: i64, quote_id: i32, wpm: i16, accuracy: i8, user_id: i32) +pub fn post_test(test_type: &str, test_length: u32, test_time: u32, test_seed: i64, quote_id: i32, wpm: u8, accuracy: u8, user_id: u32) -> Result<()> { let connection = get_connection();