summaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/models.rs b/src/models.rs
index b3d653f..3837b3d 100644
--- a/src/models.rs
+++ b/src/models.rs
@@ -3,6 +3,7 @@ use crate::schema::strava_tokens;
use crate::schema::users;
use chrono::DateTime;
use chrono::Utc;
+use std::fmt;
#[derive(Insertable, Queryable)]
#[table_name = "config"]
@@ -20,12 +21,22 @@ pub struct NewUser<'a> {
pub password: &'a str,
}
-#[derive(Queryable)]
+#[derive(Queryable, Clone)]
pub struct User {
pub username: String,
pub password: String,
}
+impl fmt::Debug for User {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(
+ f,
+ "User {{ username: {}, password: <redacted> }}",
+ self.username
+ )
+ }
+}
+
#[derive(Insertable, Queryable)]
#[table_name = "strava_tokens"]
pub struct StravaToken {