How to check disposition
kgv opened this issue · 1 comments
kgv commented
How to check "disposition" after create key with create_subkey
?
Maybe return enum Disposition { Created(RegKey), Opened(RegKey) }
?
gentoo90 commented
What time is it? Time to break some API.
Version 0.6.0
released.
create_subkey
,create_subkey_with_flags
,create_subkey_transacted
andcreate_subkey_transacted_with_flags
now return a tuple which contains the subkey and its disposition which can beREG_CREATED_NEW_KEY
orREG_OPENED_EXISTING_KEY
e.g.
let (key, disp) = hkcu.create_subkey(&path)?;
which is more ergonomic than
enum Disposition { Created(RegKey), Opened(RegKey) }
because users who aren't interested in disposition can just ignore it:
let (key, _) = hkcu.create_subkey(&path)?;
while with your variant they would be forced to use match
to get to the key