Skip to content

Instantly share code, notes, and snippets.

@goyox86
Created March 16, 2017 11:40
Show Gist options
  • Save goyox86/b0d2c7241223dd7bd1800c85bf3fee66 to your computer and use it in GitHub Desktop.
Save goyox86/b0d2c7241223dd7bd1800c85bf3fee66 to your computer and use it in GitHub Desktop.
impl From<NewUser> for NewUserReadyForInsertion {
fn from(user: NewUser) -> NewUserReadyForInsertion {
NewUserReadyForInsertion {
name: user.name,
username: user.username,
email: user.email,
// TODO: Adress this unwrap
hashed_password: hash(&user.password, DEFAULT_COST).unwrap()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment