Skip to content

Commit ede9f8d

Browse files
committed
progress
1 parent 371bded commit ede9f8d

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

crates/pgls_configuration/src/database.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ impl PartialDatabaseConfiguration {
7373
pub fn from_env() -> Option<Self> {
7474
let database_url = std::env::var("DATABASE_URL").ok();
7575
let pghost = std::env::var("PGHOST").ok();
76-
let pgport = std::env::var("PGPORT")
77-
.ok()
78-
.and_then(|p| p.parse().ok());
76+
let pgport = std::env::var("PGPORT").ok().and_then(|p| p.parse().ok());
7977
let pguser = std::env::var("PGUSER").ok();
8078
let pgpassword = std::env::var("PGPASSWORD").ok();
8179
let pgdatabase = std::env::var("PGDATABASE").ok();

crates/pgls_env/src/lib.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,9 @@ impl PgLSEnv {
7676
"DATABASE_URL",
7777
"A connection string that encodes the full database connection setup.",
7878
),
79-
pghost: PgLSEnvVariable::new(
80-
"PGHOST",
81-
"The host of the database server.",
82-
),
83-
pgport: PgLSEnvVariable::new(
84-
"PGPORT",
85-
"The port of the database server.",
86-
),
87-
pguser: PgLSEnvVariable::new(
88-
"PGUSER",
89-
"The username to connect to the database.",
90-
),
79+
pghost: PgLSEnvVariable::new("PGHOST", "The host of the database server."),
80+
pgport: PgLSEnvVariable::new("PGPORT", "The port of the database server."),
81+
pguser: PgLSEnvVariable::new("PGUSER", "The username to connect to the database."),
9182
pgpassword: PgLSEnvVariable::new(
9283
"PGPASSWORD",
9384
"The password to connect to the database.",

0 commit comments

Comments
 (0)