diff options
| author | Conrad Ludgate <conradludgate@gmail.com> | 2021-05-09 21:17:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-09 21:17:24 +0100 |
| commit | de2e34ac500c17e80fe4dcf2ed1c08add8998fa3 (patch) | |
| tree | aca08817ace6e0bd6a7dfc21615b2ed8b62f3a05 /atuin-server/src/models.rs | |
| parent | Add logout, only login if not already logged in (#91) (diff) | |
| download | atuin-de2e34ac500c17e80fe4dcf2ed1c08add8998fa3.zip | |
some changes :shrug: (#83)
* make everything a cow
* fmt + clippy
Diffstat (limited to 'atuin-server/src/models.rs')
| -rw-r--r-- | atuin-server/src/models.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/atuin-server/src/models.rs b/atuin-server/src/models.rs index fbf1897e..d493153a 100644 --- a/atuin-server/src/models.rs +++ b/atuin-server/src/models.rs @@ -1,3 +1,5 @@ +use std::borrow::Cow; + use chrono::prelude::*; #[derive(sqlx::FromRow)] @@ -14,12 +16,12 @@ pub struct History { } pub struct NewHistory<'a> { - pub client_id: &'a str, + pub client_id: Cow<'a, str>, pub user_id: i64, - pub hostname: &'a str, + pub hostname: Cow<'a, str>, pub timestamp: chrono::NaiveDateTime, - pub data: &'a str, + pub data: Cow<'a, str>, } #[derive(sqlx::FromRow)] @@ -37,13 +39,13 @@ pub struct Session { pub token: String, } -pub struct NewUser { - pub username: String, - pub email: String, - pub password: String, +pub struct NewUser<'a> { + pub username: Cow<'a, str>, + pub email: Cow<'a, str>, + pub password: Cow<'a, str>, } pub struct NewSession<'a> { pub user_id: i64, - pub token: &'a str, + pub token: Cow<'a, str>, } |
