diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-13 15:20:03 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-03-13 15:20:03 +0100 |
commit | fd52e266c6e25999a49c36f17342977b759a2612 (patch) | |
tree | 9c727cac949c9698343d003ee87cfe73c6c6204a /planetwars-server/src/lib.rs | |
parent | f7655005ff099e8314ecd31e95b26ad74d4efd02 (diff) | |
download | planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.tar.xz planetwars.dev-fd52e266c6e25999a49c36f17342977b759a2612.zip |
apply clippy suggestions
Diffstat (limited to 'planetwars-server/src/lib.rs')
-rw-r--r-- | planetwars-server/src/lib.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/planetwars-server/src/lib.rs b/planetwars-server/src/lib.rs index 6cc2824..51d6613 100644 --- a/planetwars-server/src/lib.rs +++ b/planetwars-server/src/lib.rs @@ -10,7 +10,6 @@ pub mod util; use std::ops::Deref; -use axum; use bb8::{Pool, PooledConnection}; use bb8_diesel::{self, DieselConnectionManager}; use diesel::{Connection, PgConnection}; @@ -60,13 +59,13 @@ pub async fn prepare_db(database_url: &str) -> Pool<DieselConnectionManager<PgCo let manager = DieselConnectionManager::<PgConnection>::new(database_url); let pool = bb8::Pool::builder().build(manager).await.unwrap(); seed_simplebot(&pool).await; - return pool; + pool } pub async fn api(configuration: Configuration) -> Router { let db_pool = prepare_db(&configuration.database_url).await; - let api = Router::new() + Router::new() .route("/register", post(routes::users::register)) .route("/login", post(routes::users::login)) .route("/users/me", get(routes::users::current_user)) @@ -91,8 +90,7 @@ pub async fn api(configuration: Configuration) -> Router { ) .route("/submit_bot", post(routes::demo::submit_bot)) .route("/save_bot", post(routes::bots::save_bot)) - .layer(AddExtensionLayer::new(db_pool)); - api + .layer(AddExtensionLayer::new(db_pool)) } pub async fn app() -> Router { |