clean code with clippy
This commit is contained in:
@ -140,7 +140,7 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM trip WHERE i
|
||||
notes: Option<&str>,
|
||||
trip_type: Option<i64>, //TODO: Move to `TripType`
|
||||
) -> Result<(), TripUpdateError> {
|
||||
if !trip.is_trip_from_user(cox.id).await {
|
||||
if !trip.is_trip_from_user(cox.id) {
|
||||
return Err(TripUpdateError::NotYourTrip);
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM trip WHERE i
|
||||
return Err(TripDeleteError::SomebodyAlreadyRegistered);
|
||||
}
|
||||
|
||||
if !self.is_trip_from_user(user.id).await {
|
||||
if !self.is_trip_from_user(user.id) {
|
||||
return Err(TripDeleteError::NotYourTrip);
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM trip WHERE i
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn is_trip_from_user(&self, user_id: i64) -> bool {
|
||||
fn is_trip_from_user(&self, user_id: i64) -> bool {
|
||||
self.cox_id == user_id
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user