diff --git a/src/api.rs b/src/api.rs index 1101265..1f72074 100644 --- a/src/api.rs +++ b/src/api.rs @@ -45,8 +45,8 @@ pub struct Response { message: Option, } -fn change_password(data: Json, - context: rocket::State) -> Result<()> { +fn change_password(data: &Json, + context: &rocket::State) -> Result<()> { let dn = Handlebars::new() .render_template(&context.dn, &json!({"username" : &data.username})) @@ -72,7 +72,7 @@ fn change_password(data: Json, pub fn update(data: Json, context: rocket::State) -> Json { Json( - match change_password(data, context) { + match change_password(&data, &context) { Ok(_) => Response{ success: true, message: None,