From bd69c6055970d664e622bac474eb81fe7b894758 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Sat, 15 Apr 2023 11:50:17 +0200 Subject: [PATCH] cargo clippy --- src/controllers/admin_controller.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/controllers/admin_controller.rs b/src/controllers/admin_controller.rs index d4a934e..1b7e8d3 100644 --- a/src/controllers/admin_controller.rs +++ b/src/controllers/admin_controller.rs @@ -234,14 +234,16 @@ pub async fn users_route( } pub async fn create_user(admin: CurrentUser, clients: web::Data) -> impl Responder { - let mut user = User::default(); - user.authorized_clients = Some( - clients - .get_default_clients() - .iter() - .map(|u| u.id.clone()) - .collect(), - ); + let user = User { + authorized_clients: Some( + clients + .get_default_clients() + .iter() + .map(|u| u.id.clone()) + .collect(), + ), + ..Default::default() + }; HttpResponse::Ok().body( EditUserTemplate {