From 1fdf2948fb9b9c4363811ede8f19394b9f9a4762 Mon Sep 17 00:00:00 2001 From: Sandro Eiler Date: Tue, 30 Jan 2024 16:19:19 +0100 Subject: [PATCH] docs: add doc strings and README info --- README.md | 10 ++++++++++ src/main.rs | 1 + src/startup.rs | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/README.md b/README.md index e2169a2..e3e721b 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,13 @@ Current contribution workflow is: 2. Use `cz c` to add a commit 3. Push changes 4. Open pull/merge request + +## Maintainance + +**Versioning:** +TODO; explain versioning + +**Check for unused dependencies:** +```sh +cargo +nightly udeps --all-targets +``` diff --git a/src/main.rs b/src/main.rs index 98279ba..f1b50c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use sqlx::PgPool; use tokio::net::TcpListener; #[tokio::main] +/// Entry point for the application. async fn main() { let configuration = get_configuration().expect("Failed to read configuration."); let addr = format!("127.0.0.1:{}", configuration.application_port); diff --git a/src/startup.rs b/src/startup.rs index 3495c4a..1a0c9ce 100644 --- a/src/startup.rs +++ b/src/startup.rs @@ -5,6 +5,8 @@ use sqlx::PgPool; use tokio::net::TcpListener; /// API routing +/// +/// * `connection`: The postgres connection pool pub fn app(connection: PgPool) -> Router { Router::new() .merge(crate::routes::routes_health_check()) @@ -12,6 +14,9 @@ pub fn app(connection: PgPool) -> Router { } /// Start the server +/// +/// * `listener`: The TCP listener +/// * `connection`: The postgres connection pool pub fn run(listener: TcpListener, connection: PgPool) -> Serve, Router> { axum::serve(listener, app(connection).into_make_service()) }