[rfc][icedtea-web] improved home finding to use variables first
Alex Kashchenko
akashche at redhat.com
Wed Dec 5 10:48:32 UTC 2018
On 12/04/2018 01:46 PM, Jiri Vanek wrote:
> On 12/4/18 1:44 PM, Alex Kashchenko wrote:
>> On 12/03/2018 02:33 PM, Jiri Vanek wrote:
>>> On 11/30/18 5:41 PM, Alex Kashchenko wrote:
>>>> Hi,
>>>>
>>>> On 11/29/2018 12:32 PM, Jiri Vanek wrote:
>>>>>
>>>>
>>>> env::home_dir is deprecated since 1.29, it should not be used in get_home.
>>>>
>>>> Probing for HOME and USERPROFILE should be OS-specific (to not pickup HOME on windows).
>>>>
>>>
>>>
>>> Here you go!
>>>
>>> The number of os-specific functions is growing :(
>>
>> Looks good, except the usage of a deprecated env::home_dir inside get_home, please use something
>> like this instead:
>
> Oh pleeeease.... I think it is much nicer to survive one deprecation, especially when the direction
> was made clear exactly by following the deprection pointers.
> Are you sure you want this duplicate from env::home_dir instead of callto env::home_dir?
I think it is better to avoid using deprecated API in a new code,
especially with Rust fast pacing release cycle.
> How will windows counterpart handle home?
With GetUserProfileDirectoryW [1] or SHGetKnownFolderPath [2].
[1]
https://docs.microsoft.com/en-us/windows/desktop/api/userenv/nf-userenv-getuserprofiledirectoryw
[2]
https://docs.microsoft.com/en-us/windows/desktop/api/shlobj_core/nf-shlobj_core-shgetknownfolderpath
>
> [...]
>
--
-Alex
More information about the distro-pkg-dev
mailing list