clean code with clippy
This commit is contained in:
@ -131,11 +131,8 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM trip WHERE i
|
||||
.fetch_one(db)
|
||||
.await
|
||||
.unwrap(); //TODO: fixme
|
||||
let trip_details_id = match trip_details.id {
|
||||
Some(id) => id,
|
||||
None => {
|
||||
let Some(trip_details_id) = trip_details.id else {
|
||||
return Err(TripUpdateError::TripDoesNotExist);
|
||||
}
|
||||
};
|
||||
|
||||
sqlx::query!(
|
||||
@ -152,14 +149,14 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM trip WHERE i
|
||||
}
|
||||
|
||||
pub async fn delete_by_planned_event_id(db: &SqlitePool, user_id: i64, planned_event_id: i64) {
|
||||
let _ = sqlx::query!(
|
||||
sqlx::query!(
|
||||
"DELETE FROM trip WHERE cox_id = ? AND planned_event_id = ?",
|
||||
user_id,
|
||||
planned_event_id
|
||||
)
|
||||
.execute(db)
|
||||
.await
|
||||
.is_ok();
|
||||
.unwrap(); //TODO: fixme
|
||||
}
|
||||
|
||||
pub(crate) async fn delete(
|
||||
|
Reference in New Issue
Block a user