@@ -3,7 +3,7 @@ use std::ffi::c_void;
33use objc2:: { class, msg_send, rc:: Retained , Encode , Encoding , MainThreadMarker } ;
44use objc2_foundation:: { NSDictionary , NSObject , NSString , NSURL } ;
55
6- use crate :: { Browser , BrowserOptions , Error , ErrorKind , Result , TargetType } ;
6+ use crate :: { Browser , BrowserOptions , Error , Result , TargetType } ;
77
88/// Returns `UIApplication`
99#[ allow( non_snake_case) ]
@@ -50,24 +50,20 @@ pub(super) fn open_browser_internal(
5050 return Ok ( ( ) ) ;
5151 }
5252
53- let mtm = MainThreadMarker :: new ( ) . ok_or ( Error :: new (
54- ErrorKind :: Other ,
53+ let mtm = MainThreadMarker :: new ( ) . ok_or ( Error :: other (
5554 "UIApplication must be retrieved on the main thread" ,
5655 ) ) ?;
5756
58- let app = sharedApplication ( mtm) . ok_or ( Error :: new (
59- ErrorKind :: Other ,
57+ let app = sharedApplication ( mtm) . ok_or ( Error :: other (
6058 "UIApplication is NULL, perhaps UIApplicationMain has not been executed?" ,
6159 ) ) ?;
6260
6361 // Create ns string class from our string
6462 let url_string = NSString :: from_str ( url) ;
6563 // Create NSURL object with given string
6664 #[ allow( unused_unsafe) ] // fix lint for now, eventually remove unsafe
67- let url_object = unsafe { NSURL :: URLWithString ( & url_string) } . ok_or ( Error :: new (
68- ErrorKind :: Other ,
69- "Failed creating NSURL; is the URL valid?" ,
70- ) ) ?;
65+ let url_object = unsafe { NSURL :: URLWithString ( & url_string) }
66+ . ok_or ( Error :: other ( "Failed creating NSURL; is the URL valid?" ) ) ?;
7167 // empty options dictionary
7268 let options = NSDictionary :: new ( ) ;
7369
0 commit comments