File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ rquickjs-extra-utils = { path = "../../libs/utils" }
1818libc = " 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 "
2323windows-version = " 0.1"
2424
2525[dev-dependencies ]
Original file line number Diff line number Diff line change 11use 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 ;
44use windows_version:: OsVersion ;
55
66static 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
You can’t perform that action at this time.
0 commit comments