diff --git a/Cargo.lock b/Cargo.lock index 3940577..a8a54c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,9 +40,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.19" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", @@ -70,22 +70,22 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.9" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -338,18 +338,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.42" +version = "4.5.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed87a9d530bb41a67537289bafcac159cb3ee28460e0a4571123d2a778a6a882" +checksum = "50fd97c9dc2399518aa331917ac6f274280ec5eb34e555dd291899745c48ec6f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.42" +version = "4.5.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f4f3f3c77c94aff3c7e9aac9a2ca1974a5adf392a8bb751e827d6d127ab966" +checksum = "c35b5830294e1fa0462034af85cc95225a4cb07092c088c55bda3147cfcd8f65" dependencies = [ "anstyle", "clap_lex", @@ -2444,7 +2444,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.2.0", + "security-framework 3.3.0", ] [[package]] @@ -2528,9 +2528,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +checksum = "80fb1d92c5028aa318b4b8bd7302a5bfcf48be96a37fc6fc790f806b0004ee0c" dependencies = [ "bitflags 2.9.1", "core-foundation 0.10.1", @@ -4014,9 +4014,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbb9122ea75b11bf96e7492afb723e8a7fbe12c67417aa95e7e3d18144d37cd" +checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" dependencies = [ "yoke", "zerofrom", diff --git a/examples/portal_corp_extension/src/main.rs b/examples/portal_corp_extension/src/main.rs index 237bf4f..2b25132 100644 --- a/examples/portal_corp_extension/src/main.rs +++ b/examples/portal_corp_extension/src/main.rs @@ -10,7 +10,7 @@ use tracing::info; use postgresql_embedded::{PostgreSQL, Settings, VersionReq}; -/// Example of how to install and configure the PortalCorp pgvector extension. +/// Example of how to install and configure the `PortalCorp` pgvector extension. /// /// See: #[tokio::main] diff --git a/examples/tensor_chord_extension/src/main.rs b/examples/tensor_chord_extension/src/main.rs index a4054d9..4ce9f0b 100644 --- a/examples/tensor_chord_extension/src/main.rs +++ b/examples/tensor_chord_extension/src/main.rs @@ -9,7 +9,7 @@ use tracing::info; use postgresql_embedded::{PostgreSQL, Settings, VersionReq}; -/// Example of how to install and configure the TensorChord vector extension. +/// Example of how to install and configure the `TensorChord` vector extension. /// /// See: #[tokio::main] diff --git a/postgresql_embedded/src/postgresql.rs b/postgresql_embedded/src/postgresql.rs index 346bfaf..036dda1 100644 --- a/postgresql_embedded/src/postgresql.rs +++ b/postgresql_embedded/src/postgresql.rs @@ -55,15 +55,15 @@ impl PostgreSQL { // conflicts with other versions. This will also facilitate setting the status of the // server to the correct initial value. If the minor and release version are not set, the // installation directory will be determined dynamically during the installation process. - if !postgresql.settings.trust_installation_dir { - if let Some(version) = postgresql.settings.version.exact_version() { - let path = &postgresql.settings.installation_dir; - let version_string = version.to_string(); - - if !path.ends_with(&version_string) { - postgresql.settings.installation_dir = - postgresql.settings.installation_dir.join(version_string); - } + if !postgresql.settings.trust_installation_dir + && let Some(version) = postgresql.settings.version.exact_version() + { + let path = &postgresql.settings.installation_dir; + let version_string = version.to_string(); + + if !path.ends_with(&version_string) { + postgresql.settings.installation_dir = + postgresql.settings.installation_dir.join(version_string); } } postgresql @@ -103,10 +103,11 @@ impl PostgreSQL { .file_name() .and_then(|file_name| Version::parse(&file_name.to_string_lossy()).ok()); // If this directory matches the version requirement, we're done. - if let Some(path_version) = maybe_path_version { - if self.settings.version.matches(&path_version) && path.exists() { - return Some(path.clone()); - } + if let Some(path_version) = maybe_path_version + && self.settings.version.matches(&path_version) + && path.exists() + { + return Some(path.clone()); } // Get all directories in the path as versions. diff --git a/postgresql_embedded/src/settings.rs b/postgresql_embedded/src/settings.rs index 9f09dfa..e5b2a3c 100644 --- a/postgresql_embedded/src/settings.rs +++ b/postgresql_embedded/src/settings.rs @@ -198,12 +198,12 @@ impl Settings { } let configuration_prefix = "configuration."; for (key, value) in &query_parameters { - if key.starts_with(configuration_prefix) { - if let Some(configuration_key) = key.strip_prefix(configuration_prefix) { - settings - .configuration - .insert(configuration_key.to_string(), value.to_string()); - } + if key.starts_with(configuration_prefix) + && let Some(configuration_key) = key.strip_prefix(configuration_prefix) + { + settings + .configuration + .insert(configuration_key.to_string(), value.to_string()); } }