removed uneeded functions
This commit is contained in:
parent
08accea6af
commit
9e889a38c5
|
|
@ -103,17 +103,7 @@ pub struct User {
|
||||||
pub auth: Option<Auth>,
|
pub auth: Option<Auth>,
|
||||||
pub username: String,
|
pub username: String,
|
||||||
}
|
}
|
||||||
impl User {
|
|
||||||
pub fn new(username: String) -> Self {
|
|
||||||
let id = None;
|
|
||||||
let auth = Default::default();
|
|
||||||
Self {
|
|
||||||
id,
|
|
||||||
auth,
|
|
||||||
username,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[derive(Clone, Default, Serialize, Deserialize)]
|
#[derive(Clone, Default, Serialize, Deserialize)]
|
||||||
pub struct Auth {
|
pub struct Auth {
|
||||||
#[serde(rename = "_hash", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "_hash", skip_serializing_if = "Option::is_none")]
|
||||||
|
|
@ -121,14 +111,3 @@ pub struct Auth {
|
||||||
#[serde(rename = "_salt", skip_serializing_if = "Option::is_none")]
|
#[serde(rename = "_salt", skip_serializing_if = "Option::is_none")]
|
||||||
pub salt: Option<String>,
|
pub salt: Option<String>,
|
||||||
}
|
}
|
||||||
impl Auth {
|
|
||||||
pub fn from_hash(hash: String) -> Self {
|
|
||||||
let salt = None;
|
|
||||||
let hash = Some(hash);
|
|
||||||
|
|
||||||
Self {
|
|
||||||
hash,
|
|
||||||
salt,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue