File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ struct IoErrorWrapper(io::Error);
2121
2222impl From < jni:: errors:: Error > for IoErrorWrapper {
2323 fn from ( value : jni:: errors:: Error ) -> Self {
24- IoErrorWrapper ( io:: Error :: other ( value) )
24+ IoErrorWrapper ( io:: Error :: new ( io :: ErrorKind :: Other , value) )
2525 }
2626}
2727impl From < io:: Error > for IoErrorWrapper {
@@ -110,7 +110,10 @@ impl Android {
110110 ) ;
111111
112112 let java_class = JAVA_CLASS . get ( ) . ok_or_else ( || {
113- io:: Error :: other ( "Android activity not set. Call Android::initialize* first." )
113+ io:: Error :: new (
114+ io:: ErrorKind :: Other ,
115+ "Android activity not set. Call Android::initialize* first." ,
116+ )
114117 } ) ?;
115118 JavaVM :: singleton ( ) ?. attach_current_thread ( |env| -> Result < ( ) , IoErrorWrapper > {
116119 let title = env. new_string ( input. title . as_deref ( ) . unwrap_or ( DEFAULT_TITLE ) ) ?;
@@ -151,7 +154,7 @@ impl Android {
151154 . l ( ) ?;
152155 if !result. is_null ( ) {
153156 let result = JString :: cast_local ( env, result) ?;
154- Err ( io:: Error :: other ( result. to_string ( ) ) . into ( ) )
157+ Err ( io:: Error :: new ( io :: ErrorKind :: Other , result. to_string ( ) ) . into ( ) )
155158 } else {
156159 Ok ( ( ) )
157160 }
Original file line number Diff line number Diff line change @@ -79,8 +79,12 @@ impl Backend for IOS {
7979 ) -> io:: Result < ( ) > {
8080 let callback = Arc :: new ( Mutex :: new ( Some ( callback) ) ) ;
8181
82- let mtm = MainThreadMarker :: new ( )
83- . ok_or_else ( || io:: Error :: other ( "IOS backend can only be used on main thread" ) ) ?;
82+ let mtm = MainThreadMarker :: new ( ) . ok_or_else ( || {
83+ io:: Error :: new (
84+ io:: ErrorKind :: Other ,
85+ "IOS backend can only be used on main thread" ,
86+ )
87+ } ) ?;
8488
8589 let title = input. title . as_deref ( ) . unwrap_or ( DEFAULT_TITLE ) ;
8690 let prompt_ns = input. prompt . as_deref ( ) . map ( NSString :: from_str) ;
@@ -215,7 +219,8 @@ impl Backend for IOS {
215219 alert. addAction ( & ok_action) ;
216220
217221 let top_vc = Self :: get_top_view_controller ( mtm) . ok_or_else ( || {
218- io:: Error :: other (
222+ io:: Error :: new (
223+ io:: ErrorKind :: Other ,
219224 "no active window or view controller found to present the input dialog" ,
220225 )
221226 } ) ?;
You can’t perform that action at this time.
0 commit comments