1515// along with Parity. If not, see <http://www.gnu.org/licenses/>.
1616
1717//! Path utilities
18+ extern crate dirs;
19+
1820use std:: path:: Path ;
1921use std:: path:: PathBuf ;
2022
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 = dirs :: 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 = dirs :: 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 = dirs :: home_dir ( ) . expect ( "Failed to get home dir" ) ;
4749 home. push ( format ! ( ".{}" , name. to_lowercase( ) ) ) ;
4850 home
4951}
0 commit comments