Fix env::home_dir() deprecation warning.#9281
Conversation
|
It looks like @c0gent hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io Once you've signed, please reply to this thread with Many thanks, Parity Technologies CLA Bot |
|
[clabot:check] |
|
It looks like @c0gent signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
|
Thanks for the PR. However we reverted the exact same change some time ago because the |
|
My mistake. I didn't see that PR. Should I add some |
2d66415 to
cd0d5ff
Compare
|
Updated with exceptions for Android. |
|
In my opinion the cost of making the code dirty is higher than seeing this small warning when you compile. I would personally prefer an For me the proper fix is to change the code so that the Parity binary introduces $HOME into the library part, but that's a much bigger change. |
|
I see what you mean and I hear you 100% about the code dirtyness but because it will be such a large amount of work to make such a minor thing work spotlessly, and because the drawbacks of the quick fix are so few (other than it bothering us), I think it would be better to merge and leave an open issue until the time can be spent. |
|
I can optionally just leave the deprecation warnings enabled on Android as reminders (they are suppressed currently). |
|
My number one preference would be to leave the warning for now and fix it properly. I don't think having platform-specific code is a good thing here. |
|
I understand completely. I can add a I can close this PR for now. I won't have time to do a proper implementation right away. |
* Import the `dirs` crate in `util/dir`. * Replace uses of `env::home_dir()` with `dirs::home_dir()`. * Reexport `dirs::home_dir`. * Continue to use `std::env::home_dir` on Android. * Bump `util/dir` to 0.1.2.
dirscrate inutil/dir.env::home_dir()withdirs::home_dir().dirs::home_dir.std::env::home_diron Android.