mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-02 11:50:01 +00:00
fix(postgres): remove home crate in favor of std::env::home_dir (#4171)
`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 https://github.com/rust-lang/cargo/issues/12297
This commit is contained in:
parent
d9b3340d2f
commit
0a9eac1876
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -3954,7 +3954,6 @@ dependencies = [
|
||||
"hex",
|
||||
"hkdf",
|
||||
"hmac",
|
||||
"home",
|
||||
"ipnet",
|
||||
"ipnetwork",
|
||||
"itoa",
|
||||
|
||||
@ -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 }
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user