From c70a1eb443fa4471559881272d76cffb3d62588e Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Fri, 2 Jan 2026 13:40:45 +0100 Subject: [PATCH] Bump version to 0.1.4 and improve DatabaseConfig default implementation --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/db.rs | 28 ++++++++++++++++------------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc151be..c42e760 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -747,7 +747,7 @@ dependencies = [ [[package]] name = "k-core" -version = "0.1.3" +version = "0.1.4" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index f868d37..8b0d5a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "k-core" -version = "0.1.3" +version = "0.1.4" edition = "2024" [features] diff --git a/src/db.rs b/src/db.rs index ee7d81d..8f8a18c 100644 --- a/src/db.rs +++ b/src/db.rs @@ -19,20 +19,24 @@ pub struct DatabaseConfig { impl Default for DatabaseConfig { fn default() -> Self { #[cfg(feature = "sqlite")] - Self { - url: "sqlite::memory:".to_string(), - max_connections: 5, - min_connections: 1, - acquire_timeout: Duration::from_secs(30), - }; + { + Self { + url: "sqlite::memory:".to_string(), + max_connections: 5, + min_connections: 1, + acquire_timeout: Duration::from_secs(30), + } + } #[cfg(all(not(feature = "sqlite"), feature = "postgres"))] - Self { - url: "postgres://localhost:5432/mydb".to_string(), - max_connections: 5, - min_connections: 1, - acquire_timeout: Duration::from_secs(30), - }; + { + Self { + url: "postgres://localhost:5432/mydb".to_string(), + max_connections: 5, + min_connections: 1, + acquire_timeout: Duration::from_secs(30), + } + } #[cfg(not(any(feature = "sqlite", feature = "postgres")))] Self {