Skip to content

Commit f884d77

Browse files
dvdplmordian
authored andcommitted
Fix deprecation warning (#168)
* Fix warning * Edition * Bump version * Switch home-dir resolver to the home crate * Update parity-path/Cargo.toml Co-Authored-By: Andronik Ordian <write@reusable.software>
1 parent b0ec18d commit f884d77

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

parity-path/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[package]
22
name = "parity-path"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
authors = ["Parity Technologies <admin@parity.io>"]
55
repository = "https://github.com/paritytech/parity-common"
66
description = "Path utilities"
77
license = "GPL-3.0"
8+
edition = "2018"
89

910
[dependencies]
11+
home = "0.5"

parity-path/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
use std::path::Path;
1919
use std::path::PathBuf;
2020

21+
use home::home_dir;
22+
2123
#[cfg(target_os = "macos")]
2224
/// Get the config path for application `name`.
2325
/// `name` should be capitalized, e.g. `"Ethereum"`, `"Parity"`.
2426
pub fn config_path(name: &str) -> PathBuf {
25-
let mut home = ::std::env::home_dir().expect("Failed to get home dir");
27+
let mut home = home_dir().expect("Failed to get home dir");
2628
home.push("Library");
2729
home.push(name);
2830
home
@@ -32,7 +34,7 @@ pub fn config_path(name: &str) -> PathBuf {
3234
/// Get the config path for application `name`.
3335
/// `name` should be capitalized, e.g. `"Ethereum"`, `"Parity"`.
3436
pub fn config_path(name: &str) -> PathBuf {
35-
let mut home = ::std::env::home_dir().expect("Failed to get home dir");
37+
let mut home = home_dir().expect("Failed to get home dir");
3638
home.push("AppData");
3739
home.push("Roaming");
3840
home.push(name);
@@ -43,7 +45,7 @@ pub fn config_path(name: &str) -> PathBuf {
4345
/// Get the config path for application `name`.
4446
/// `name` should be capitalized, e.g. `"Ethereum"`, `"Parity"`.
4547
pub fn config_path(name: &str) -> PathBuf {
46-
let mut home = ::std::env::home_dir().expect("Failed to get home dir");
48+
let mut home = home_dir().expect("Failed to get home dir");
4749
home.push(format!(".{}", name.to_lowercase()));
4850
home
4951
}

0 commit comments

Comments
 (0)