no more clones!
This commit is contained in:
		| @@ -79,10 +79,10 @@ WHERE day=?", | |||||||
|                 trip_type = TripType::find_by_id(db, trip_type_id).await; |                 trip_type = TripType::find_by_id(db, trip_type_id).await; | ||||||
|             } |             } | ||||||
|             ret.push(PlannedEventWithUserAndTriptype { |             ret.push(PlannedEventWithUserAndTriptype { | ||||||
|                 planned_event: event.clone(), |  | ||||||
|                 cox_needed: event.planned_amount_cox > cox.len() as i64, |                 cox_needed: event.planned_amount_cox > cox.len() as i64, | ||||||
|                 cox, |                 cox, | ||||||
|                 rower: event.get_all_rower(db).await, |                 rower: event.get_all_rower(db).await, | ||||||
|  |                 planned_event: event, | ||||||
|                 trip_type, |                 trip_type, | ||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -113,9 +113,9 @@ ORDER BY name | |||||||
|                                                                 //been deleted |                                                                 //been deleted | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         match user.pw.clone() { |         match user.pw.as_ref() { | ||||||
|             Some(user_pw) => { |             Some(user_pw) => { | ||||||
|                 let password_hash = Self::get_hashed_pw(&pw); |                 let password_hash = &Self::get_hashed_pw(&pw); | ||||||
|                 if password_hash == user_pw { |                 if password_hash == user_pw { | ||||||
|                     return Ok(user); |                     return Ok(user); | ||||||
|                 } |                 } | ||||||
|   | |||||||
| @@ -98,7 +98,6 @@ async fn create( | |||||||
|     _admin: AdminUser, |     _admin: AdminUser, | ||||||
| ) -> Flash<Redirect> { | ) -> Flash<Redirect> { | ||||||
|     if User::create(db, data.name, data.is_guest).await { |     if User::create(db, data.name, data.is_guest).await { | ||||||
|         //TODO: fix clone() above |  | ||||||
|         Flash::success(Redirect::to("/admin/user"), "Successfully created user") |         Flash::success(Redirect::to("/admin/user"), "Successfully created user") | ||||||
|     } else { |     } else { | ||||||
|         Flash::error( |         Flash::error( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user