File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[package ]
22name = " parity-path"
3- version = " 0.1.1 "
3+ version = " 0.1.2 "
44authors = [" Parity Technologies <admin@parity.io>" ]
55repository = " https://github.com/paritytech/parity-common"
66description = " Path utilities"
77license = " GPL-3.0"
8+ edition = " 2018"
89
910[dependencies ]
11+ home = " 0.5"
Original file line number Diff line number Diff line change 1818use std:: path:: Path ;
1919use 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"`.
2426pub 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"`.
3436pub 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"`.
4547pub 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}
You can’t perform that action at this time.
0 commit comments