diff --git a/Cargo.lock b/Cargo.lock index fe01e11720..236039f0ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3954,7 +3954,6 @@ dependencies = [ "hex", "hkdf", "hmac", - "home", "ipnet", "ipnetwork", "itoa", diff --git a/sqlx-postgres/Cargo.toml b/sqlx-postgres/Cargo.toml index 1ab7c713ad..2943049f0b 100644 --- a/sqlx-postgres/Cargo.toml +++ b/sqlx-postgres/Cargo.toml @@ -57,7 +57,6 @@ base64 = { version = "0.22.0", default-features = false, features = ["std"] } bitflags = { version = "2", default-features = false } byteorder = { version = "1.4.3", default-features = false, features = ["std"] } hex = "0.4.3" -home = "0.5.5" itoa = "1.0.1" log = "0.4.18" memchr = { version = "2.4.1", default-features = false } diff --git a/sqlx-postgres/src/options/pgpass.rs b/sqlx-postgres/src/options/pgpass.rs index 930c5f0f51..ca904fc751 100644 --- a/sqlx-postgres/src/options/pgpass.rs +++ b/sqlx-postgres/src/options/pgpass.rs @@ -21,7 +21,9 @@ pub fn load_password( } #[cfg(not(target_os = "windows"))] - let default_file = home::home_dir().map(|path| path.join(".pgpass")); + // home_dir fixed in 1.85 (rust-lang/rust#132515) and un-deprecated in 1.87 (rust-lang/rust#137327) + #[allow(deprecated)] + let default_file = std::env::home_dir().map(|path| path.join(".pgpass")); #[cfg(target_os = "windows")] let default_file = { use etcetera::BaseStrategy;