clean code with clippy

This commit is contained in:
2023-07-25 13:22:11 +02:00
parent 3765541674
commit a7789af713
10 changed files with 243 additions and 463 deletions

View File

@ -24,20 +24,14 @@ impl Location {
}
pub async fn all(db: &SqlitePool) -> Vec<Self> {
sqlx::query_as!(
Self,
"
SELECT id, name
FROM location
"
)
.fetch_all(db)
.await
.unwrap() //TODO: fixme
sqlx::query_as!(Self, "SELECT id, name FROM location")
.fetch_all(db)
.await
.unwrap() //TODO: fixme
}
pub async fn create(db: &SqlitePool, name: &str) -> bool {
sqlx::query!("INSERT INTO location(name) VALUES (?)", name,)
sqlx::query!("INSERT INTO location(name) VALUES (?)", name)
.execute(db)
.await
.is_ok()