Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serde decoding fails with subkeys #49

Closed
lars-berger opened this issue Feb 8, 2023 · 1 comment
Closed

Serde decoding fails with subkeys #49

lars-berger opened this issue Feb 8, 2023 · 1 comment

Comments

@lars-berger
Copy link

When decoding via the serialization-serde feature, it fails with DecodeNotImplemented("deserialize_any for keys") even though I'm only interested in certain values (eg. AutoColorization only in this case).

#[derive(Debug, Serialize, Deserialize, PartialEq)]
pub struct DesktopReg {
  AutoColorization: u32,
}

pub fn decode_example() -> Result<DesktopReg> {
  let hkcu = RegKey::predef(HKEY_CURRENT_USER);
  let desktop_key = hkcu.open_subkey_with_flags("Control Panel\\Desktop", KEY_READ)?;
  
  let decoded: DesktopReg = desktop_key.decode()?;
  Ok(decoded)
}
@gentoo90
Copy link
Owner

gentoo90 commented Feb 17, 2023

Fixed in winreg-0.11.0.

PS: on my machine there's no AutoColorization value in this registry key, so you might want to use Option<u32>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants