Skip to content

Commit 9285cae

Browse files
committed
fix(postgres): remove home crate in favor of std::env::home_dir
`home_dir()` was fixed in Rust 1.85 (rust-lang/rust#132515) and un-deprecated in 1.87 (rust-lang/rust#137327). Since our MSRV is 1.86, the function is correct but still carries a deprecation warning until MSRV is bumped to 1.87. This will allow other targets to compile including WebAssembly, see rust-lang/cargo#12297
1 parent f5cdf33 commit 9285cae

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Cargo.lock

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

sqlx-postgres/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ base64 = { version = "0.22.0", default-features = false, features = ["std"] }
5757
bitflags = { version = "2", default-features = false }
5858
byteorder = { version = "1.4.3", default-features = false, features = ["std"] }
5959
hex = "0.4.3"
60-
home = "0.5.5"
6160
itoa = "1.0.1"
6261
log = "0.4.18"
6362
memchr = { version = "2.4.1", default-features = false }

sqlx-postgres/src/options/pgpass.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ pub fn load_password(
2121
}
2222

2323
#[cfg(not(target_os = "windows"))]
24-
let default_file = home::home_dir().map(|path| path.join(".pgpass"));
24+
// home_dir fixed in 1.85 (rust-lang/rust#132515) and un-deprecated in 1.87 (rust-lang/rust#137327)
25+
#[allow(deprecated)]
26+
let default_file = std::env::home_dir().map(|path| path.join(".pgpass"));
2527
#[cfg(target_os = "windows")]
2628
let default_file = {
2729
use etcetera::BaseStrategy;

0 commit comments

Comments
 (0)