databricks / click

The "Command Line Interactive Controller for Kubernetes"
Apache License 2.0
1.49k stars 84 forks source link

Use home_dir from dirs crate instead of std::env #80

Closed lofim closed 5 years ago

lofim commented 6 years ago

Compiling click on master produces 2 warnings related to the use of home_dir from the std::env package.

➜  click git:(master) cargo build
   Compiling click v0.3.2 (file:///click)                                                                                                                                 
warning: use of deprecated item 'std::env::home_dir': This function's behavior is unexpected and probably not what you want. Consider using the home_dir function from https://crates.io/crates/dirs instead.
   --> src/config.rs:329:36
    |
329 |     } else if let Some(home_dir) = env::home_dir() {
    |                                    ^^^^^^^^^^^^^
    |
    = note: #[warn(deprecated)] on by default

warning: use of deprecated item 'std::env::home_dir': This function's behavior is unexpected and probably not what you want. Consider using the home_dir function from https://crates.io/crates/dirs instead.
   --> src/main.rs:549:15
    |
549 |         match std::env::home_dir() {
    |               ^^^^^^^^^^^^^^^^^^

This PR replaces the home_dir function with the one from dirs crate as the warning suggests.

nicklan commented 5 years ago

Thanks! I merged #86 which was this + a tiny bit of cleanup