Skip to content

Commit 1276ce4

Browse files
Merge pull request #209 from theseus-rs/correct-lints
chore: correct lint errors
2 parents acf1a86 + 3fddd47 commit 1276ce4

File tree

5 files changed

+39
-38
lines changed

5 files changed

+39
-38
lines changed

Cargo.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/portal_corp_extension/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use tracing::info;
1010

1111
use postgresql_embedded::{PostgreSQL, Settings, VersionReq};
1212

13-
/// Example of how to install and configure the PortalCorp pgvector extension.
13+
/// Example of how to install and configure the `PortalCorp` pgvector extension.
1414
///
1515
/// See: <https://github.com/pgvector/pgvector?tab=readme-ov-file#getting-started>
1616
#[tokio::main]

examples/tensor_chord_extension/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tracing::info;
99

1010
use postgresql_embedded::{PostgreSQL, Settings, VersionReq};
1111

12-
/// Example of how to install and configure the TensorChord vector extension.
12+
/// Example of how to install and configure the `TensorChord` vector extension.
1313
///
1414
/// See: <https://github.com/tensorchord/pgvecto.rs/?tab=readme-ov-file#quick-start>
1515
#[tokio::main]

postgresql_embedded/src/postgresql.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ impl PostgreSQL {
5555
// conflicts with other versions. This will also facilitate setting the status of the
5656
// server to the correct initial value. If the minor and release version are not set, the
5757
// installation directory will be determined dynamically during the installation process.
58-
if !postgresql.settings.trust_installation_dir {
59-
if let Some(version) = postgresql.settings.version.exact_version() {
60-
let path = &postgresql.settings.installation_dir;
61-
let version_string = version.to_string();
62-
63-
if !path.ends_with(&version_string) {
64-
postgresql.settings.installation_dir =
65-
postgresql.settings.installation_dir.join(version_string);
66-
}
58+
if !postgresql.settings.trust_installation_dir
59+
&& let Some(version) = postgresql.settings.version.exact_version()
60+
{
61+
let path = &postgresql.settings.installation_dir;
62+
let version_string = version.to_string();
63+
64+
if !path.ends_with(&version_string) {
65+
postgresql.settings.installation_dir =
66+
postgresql.settings.installation_dir.join(version_string);
6767
}
6868
}
6969
postgresql
@@ -103,10 +103,11 @@ impl PostgreSQL {
103103
.file_name()
104104
.and_then(|file_name| Version::parse(&file_name.to_string_lossy()).ok());
105105
// If this directory matches the version requirement, we're done.
106-
if let Some(path_version) = maybe_path_version {
107-
if self.settings.version.matches(&path_version) && path.exists() {
108-
return Some(path.clone());
109-
}
106+
if let Some(path_version) = maybe_path_version
107+
&& self.settings.version.matches(&path_version)
108+
&& path.exists()
109+
{
110+
return Some(path.clone());
110111
}
111112

112113
// Get all directories in the path as versions.

postgresql_embedded/src/settings.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,12 @@ impl Settings {
198198
}
199199
let configuration_prefix = "configuration.";
200200
for (key, value) in &query_parameters {
201-
if key.starts_with(configuration_prefix) {
202-
if let Some(configuration_key) = key.strip_prefix(configuration_prefix) {
203-
settings
204-
.configuration
205-
.insert(configuration_key.to_string(), value.to_string());
206-
}
201+
if key.starts_with(configuration_prefix)
202+
&& let Some(configuration_key) = key.strip_prefix(configuration_prefix)
203+
{
204+
settings
205+
.configuration
206+
.insert(configuration_key.to_string(), value.to_string());
207207
}
208208
}
209209

0 commit comments

Comments
 (0)