clean w/ clippy
This commit is contained in:
@ -27,8 +27,7 @@ impl UserTrip {
|
||||
//TODO: Check if user sees the event (otherwise she could forge trip_details_id)
|
||||
|
||||
let is_cox = trip_details.user_is_cox(db, user).await;
|
||||
let mut name_newly_registered_person = String::new();
|
||||
if user_note.is_none() {
|
||||
let name_newly_registered_person = if user_note.is_none() {
|
||||
if let Yes(action) = is_cox {
|
||||
match action {
|
||||
Action::Helping => return Err(UserTripError::AlreadyRegisteredAsCox),
|
||||
@ -49,7 +48,7 @@ impl UserTrip {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
name_newly_registered_person = user.name.clone();
|
||||
user.name.clone()
|
||||
} else {
|
||||
if !trip_details.user_allowed_to_change(db, user).await {
|
||||
return Err(UserTripError::NotAllowedToAddGuest);
|
||||
@ -63,8 +62,8 @@ impl UserTrip {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
name_newly_registered_person = user_note.unwrap();
|
||||
}
|
||||
user_note.unwrap()
|
||||
};
|
||||
|
||||
if let Some(trip) = Trip::find_by_trip_details(db, trip_details.id).await {
|
||||
let cox = User::find_by_id(db, trip.cox_id as i32).await.unwrap();
|
||||
|
Reference in New Issue
Block a user