From 77c0b36fd3f1563af538aa4c8d83ee059c16016c Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 9 Jul 2026 10:52:31 -0400 Subject: [PATCH] Fix warnings --- src/main.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 88f5f49..8ecd1cb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,7 +61,10 @@ mod tests { db_name: &str, ) -> Result<(), sqlx::Error> { let create_query = format!("CREATE DATABASE {}", db_name); - match sqlx::query(&create_query).execute(template_pool).await { + match sqlx::query(sqlx::AssertSqlSafe(create_query)) + .execute(template_pool) + .await + { Ok(_) => Ok(()), Err(e) => Err(e), } @@ -73,7 +76,9 @@ mod tests { db_name: &str, ) -> Result<(), sqlx::Error> { let drop_query = format!("DROP DATABASE IF EXISTS {} WITH (FORCE)", db_name); - sqlx::query(&drop_query).execute(template_pool).await?; + sqlx::query(sqlx::AssertSqlSafe(drop_query)) + .execute(template_pool) + .await?; Ok(()) } @@ -106,13 +111,16 @@ mod tests { } mod init { + use std::time::Duration; + pub async fn app(pool: sqlx::PgPool) -> axum::Router { crate::config::init::routes() .await .layer(axum::Extension(pool)) .layer(axum::extract::DefaultBodyLimit::max(1024 * 1024 * 1024)) - .layer(tower_http::timeout::TimeoutLayer::new( - std::time::Duration::from_secs(300), + .layer(tower_http::timeout::TimeoutLayer::with_status_code( + axum::http::StatusCode::OK, + Duration::from_secs(300), )) } }