clean code with clippy

This commit is contained in:
2023-10-02 12:39:05 +02:00
parent 23ba9d11b5
commit bb142a0969
3 changed files with 18 additions and 19 deletions

View File

@ -148,8 +148,7 @@ ORDER BY amount_seats DESC
if user.is_admin {
return Self::all(db).await;
}
let boats;
if user.is_cox {
let boats = if user.is_cox {
boats = sqlx::query_as!(
Boat,
"
@ -162,9 +161,9 @@ ORDER BY amount_seats DESC
)
.fetch_all(db)
.await
.unwrap(); //TODO: fixme
.unwrap() //TODO: fixme
} else {
boats = sqlx::query_as!(
sqlx::query_as!(
Boat,
"
SELECT id, name, amount_seats, location_id, owner, year_built, boatbuilder, default_shipmaster_only_steering, skull, external
@ -176,8 +175,8 @@ ORDER BY amount_seats DESC
)
.fetch_all(db)
.await
.unwrap(); //TODO: fixme
}
.unwrap() //TODO: fixme
};
Self::boats_to_details(db, boats).await
}