Skip to content

Commit 9e7f63d

Browse files
committed
Update windows os deps
1 parent d3dd26f commit 9e7f63d

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

modules/os/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ rquickjs-extra-utils = { path = "../../libs/utils" }
1818
libc = "0.2"
1919

2020
[target.'cfg(windows)'.dependencies]
21-
windows-registry = "0.2"
22-
windows-result = "0.2"
21+
windows-registry = "0.5"
22+
windows-result = "0.3"
2323
windows-version = "0.1"
2424

2525
[dev-dependencies]

modules/os/src/windows.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use once_cell::sync::Lazy;
2-
use windows_registry::{Value, LOCAL_MACHINE};
3-
use windows_result::{Error, Result};
2+
use windows_registry::LOCAL_MACHINE;
3+
use windows_result::Result;
44
use windows_version::OsVersion;
55

66
static OS_RELEASE: Lazy<String> = Lazy::new(release);
@@ -29,10 +29,7 @@ fn version() -> Result<String> {
2929
let version = OsVersion::current();
3030

3131
let registry_key = LOCAL_MACHINE.open("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion")?;
32-
let value = registry_key.get_value("ProductName")?;
33-
let Value::String(mut value) = value else {
34-
return Err(Error::empty());
35-
};
32+
let mut value = registry_key.get_string("ProductName")?;
3633

3734
// Windows 11 shares dwMajorVersion with Windows 10
3835
// this workaround tries to disambiguate that by checking

0 commit comments

Comments
 (0)