remove some unneeded mutability

This commit is contained in:
Дамјан Георгиевски
2019-02-22 20:25:50 +01:00
parent aeb4b4c8a5
commit 473f8b8e31
5 changed files with 15 additions and 15 deletions

View File

@@ -225,13 +225,13 @@ impl Invitation {
Self { email }
}
pub fn save(&mut self, conn: &DbConn) -> EmptyResult {
pub fn save(&self, conn: &DbConn) -> EmptyResult {
if self.email.trim().is_empty() {
err!("Invitation email can't be empty")
}
diesel::replace_into(invitations::table)
.values(&*self)
.values(self)
.execute(&**conn)
.map_res("Error saving invitation")
}