fix: clippy io_other_error errors (#1647)

This commit is contained in:
Tunglies
2025-12-28 23:28:39 +08:00
committed by GitHub
parent 2e4850a583
commit 7b77322f88
2 changed files with 9 additions and 8 deletions

View File

@@ -0,0 +1,5 @@
---
"wry": patch
---
Fix clippy io_other_error. No user facing changes.

View File

@@ -1263,28 +1263,24 @@ pub fn platform_webview_version() -> Result<String> {
unsafe {
let Some(bundle) = NSBundle::bundleWithIdentifier(&NSString::from_str("com.apple.WebKit"))
else {
return Err(Error::Io(std::io::Error::new(
std::io::ErrorKind::Other,
return Err(Error::Io(std::io::Error::other(
"failed to locate com.apple.WebKit bundle",
)));
};
let Some(dict) = bundle.infoDictionary() else {
return Err(Error::Io(std::io::Error::new(
std::io::ErrorKind::Other,
return Err(Error::Io(std::io::Error::other(
"failed to get WebKit info dictionary",
)));
};
let Some(webkit_version) = dict.objectForKey(&NSString::from_str("CFBundleVersion")) else {
return Err(Error::Io(std::io::Error::new(
std::io::ErrorKind::Other,
return Err(Error::Io(std::io::Error::other(
"failed to get WebKit version",
)));
};
let Ok(webkit_version) = webkit_version.downcast::<NSString>() else {
return Err(Error::Io(std::io::Error::new(
std::io::ErrorKind::Other,
return Err(Error::Io(std::io::Error::other(
"failed to parse WebKit version",
)));
};