Formatting
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use serde::Deserialize;
|
||||
use crate::db;
|
||||
use crate::error::ApiResult;
|
||||
use serde::Deserialize;
|
||||
|
||||
const TABLE_NAME: &str = "user_airport_favorites";
|
||||
|
||||
@@ -19,14 +19,11 @@ impl UserFavorite {
|
||||
"#,
|
||||
TABLE_NAME
|
||||
))
|
||||
.bind(username)
|
||||
.fetch_all(pool)
|
||||
.await?;
|
||||
.bind(username)
|
||||
.fetch_all(pool)
|
||||
.await?;
|
||||
|
||||
let favorites = user_favorites
|
||||
.iter()
|
||||
.map(|uf| uf.icao.clone())
|
||||
.collect();
|
||||
let favorites = user_favorites.iter().map(|uf| uf.icao.clone()).collect();
|
||||
|
||||
Ok(favorites)
|
||||
}
|
||||
@@ -57,10 +54,10 @@ impl UserFavorite {
|
||||
"#,
|
||||
TABLE_NAME
|
||||
))
|
||||
.bind(username)
|
||||
.bind(icao)
|
||||
.execute(pool)
|
||||
.await?;
|
||||
.bind(username)
|
||||
.bind(icao)
|
||||
.execute(pool)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user