diff options
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>, } |