From 7873f5acc5b4aac7e4c765bc3dfdb5f5c0f804a8 Mon Sep 17 00:00:00 2001
From: Arlo Filley <104267514+ArloFilley@users.noreply.github.com>
Date: Mon, 31 Oct 2022 00:39:17 +0000
Subject: [PATCH 1/3] Delete .DS_Store
---
.DS_Store | Bin 10244 -> 0 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
delete mode 100644 .DS_Store
diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 1b16b2c5fb2ba1b77a16eb38d8c7c78609fc0231..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 10244
zcmeGhZEO@pblw)|9vpNFt!<$zmmWkuN+|{8J6x}=P)a}Swe
fKRW
z8L%Vj0VO8P&R}g;FfjH7TxWje6LyZ6irJ
zX>SQbZ!#6yQ&hz|ol9`@6=vLEs4iVu#3}*_vI-uT^U^gJLW^$biq97eHMta?EJe4i
zCp+*N>;O4Nj+0a59de$0O)isbkPSsp0!v{PY=X_O6>6aaVz3(|Ce5YSyLh}F*o*ii
z>#cRKh$M_;?-nP)ra~meQAxQ
zi5$H|w)?QH!|IVtrLiA(E_X!Rkm|$-
z(y365tlEath}LK*5yf`eU8O8LbC_FLlp{vOR$lm&$CXj_J{5OM3`VwT^1;v$^TS|h
ziCangrDNz|sGQ+GJo|~Hf>e|3WH;{fL*yuVlAIuKkaOe%@;Uj2{6wx|-~dd+;F%6H
zAP?rk0w{&mum;w`ItW7}G(j^&pbL6Hg}q?G01Uzq9E6AAFdTuS@F+Y1$KhFc4o<+!
z@EW`hr{PU_7tX^+@G*P_m*6}29)5t!@GJZV*SV=&0awTsaV1FyRGiO6Mz@l7bOqBCV_=Z
zmakg7sdCgcnJ=f^cWh8NkuWZPoJepyCBus^II-!!dwx0?Z-yre*H#Q6Wq_xVEM&Xf
z!38{qkTBIn7cEA#PMF5f;$>w#hO59isK2;kr4NHr$a2wTYY+v7_&03yVR#BtT=eb`
zqQpUpi>qs}oAUzyclrKBa*6y%u8`~K`?FvU6v91FjvgPz&qjme^ATu;UC!qt4l*P`
z2Ltw__aB5|cmPJ=A@u!6(EA^QWAGF_4bNZ%yZ|r4OYjQ3ivE8F-h#K`eK-r};6pbO
zzQQ>88LnpdcKvwYhF>Q4?W9p%?Vhpt$DiN!;3xCXR{jww`7cQI_WapTUth%3HAC;l
z5z$X>7M?6kk{Exggd^B8_S`$oIlt1gvO??(-fJ1W*`y!2;@Gc>QW>XRj_MuTGooJd
zEZ|wdv%np)Ko-*zpzr@RxBvhD4vofB<5|G7z&~LDm{J|74x{Gu%R}ZM=v#XL^KQ&E
zQN9rd9T6;?=Xiw9b37vSIo^3YL7IEbbL2uur}85VVhz(B|1-e5|9kiU|M~s@cZ`k1
AoB#j-
From 1b750c2cc04b7080ea7913070c24b5a237a11d0e Mon Sep 17 00:00:00 2001
From: ArloFilley
Date: Mon, 31 Oct 2022 23:18:57 +0000
Subject: [PATCH 2/3] 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();
From 670c16a940e11079fafc7f6382ebfc101eec3761 Mon Sep 17 00:00:00 2001
From: ArloFilley
Date: Tue, 1 Nov 2022 09:12:31 +0000
Subject: [PATCH 3/3] changes to main
---
src/main.rs | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 8c68be1..cdb0bc5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,6 +1,6 @@
// relevant macros and imports for rocket.rs
#[macro_use] extern crate rocket;
-use rocket::{Rocket, Build, fs::{FileServer, relative}, serde::{Deserialize, json::Json}};
+use rocket::{Rocket, Build, fs::{FileServer, relative}, serde::{Deserialize, json::Json}, Error, Response};
pub mod sql;
#[get("/")]
@@ -25,17 +25,6 @@ struct PostTest<'r> {
#[post("/post_test", data = "")]
fn post_test(test: Json>) {
- println!(
- "{}\n{}\n{}\n{}\n{}\n{}\n{}\n{}",
- test.test_type,
- test.test_length,
- test.test_time,
- test.test_seed,
- test.quote_id,
- test.wpm,
- test.accuracy,
- test.user_id
- );
sql::post_test(test.test_type, test.test_length, test.test_time, test.test_seed, test.quote_id, test.wpm, test.accuracy, test.user_id)
.expect("error in posting test to tests table");
}