@@ -16,14 +16,14 @@ pub fn handler(_attr: TokenStream, item: TokenStream) -> TokenStream {
16
16
17
17
let data = if function. sig . inputs . len ( ) == 2 {
18
18
if match function. sig . inputs . last ( ) {
19
- Some ( syn:: FnArg :: Typed ( pat) ) => match & * pat. ty {
19
+ :: core :: option :: Option :: Some ( syn:: FnArg :: Typed ( pat) ) => match & * pat. ty {
20
20
Type :: Reference ( reference) => {
21
21
reference. mutability . is_some ( )
22
22
}
23
23
_ => return quote ! { compile_error!( "Last argument must be either a reference to the shared data or should not be present at all." ) } . into ( ) ,
24
24
} ,
25
- Some ( _) => return quote ! { compile_error!( "`self` argument, really?" ) } . into ( ) ,
26
- None => unreachable ! ( ) ,
25
+ :: core :: option :: Option :: Some ( _) => return quote ! { compile_error!( "`self` argument, really?" ) } . into ( ) ,
26
+ :: core :: option :: Option :: None => unreachable ! ( ) ,
27
27
} {
28
28
quote ! {
29
29
ANYRUN_INTERNAL_DATA . write( ) . unwrap( ) . as_mut( ) . unwrap( ) ,
@@ -67,14 +67,14 @@ pub fn get_matches(_attr: TokenStream, item: TokenStream) -> TokenStream {
67
67
68
68
let fn_call = if function. sig . inputs . len ( ) == 2 {
69
69
let data = if match function. sig . inputs . last ( ) {
70
- Some ( syn:: FnArg :: Typed ( pat) ) => match & * pat. ty {
70
+ :: core :: option :: Option :: Some ( syn:: FnArg :: Typed ( pat) ) => match & * pat. ty {
71
71
Type :: Reference ( reference) => {
72
72
reference. mutability . is_some ( )
73
73
}
74
74
_ => return quote ! { compile_error!( "Last argument must be either a reference to the shared data or should not be present at all." ) } . into ( ) ,
75
75
} ,
76
- Some ( _) => return quote ! { compile_error!( "`self` argument, really?" ) } . into ( ) ,
77
- None => unreachable ! ( ) ,
76
+ :: core :: option :: Option :: Some ( _) => return quote ! { compile_error!( "`self` argument, really?" ) } . into ( ) ,
77
+ :: core :: option :: Option :: None => unreachable ! ( ) ,
78
78
} {
79
79
quote ! {
80
80
ANYRUN_INTERNAL_DATA . write( ) . unwrap( ) . as_mut( )
@@ -85,7 +85,7 @@ pub fn get_matches(_attr: TokenStream, item: TokenStream) -> TokenStream {
85
85
}
86
86
} ;
87
87
quote ! {
88
- if let Some ( data) = #data {
88
+ if let :: core :: option :: Option :: Some ( data) = #data {
89
89
#fn_name( input, data)
90
90
} else {
91
91
:: abi_stable:: std_types:: RVec :: new( )
@@ -111,7 +111,7 @@ pub fn get_matches(_attr: TokenStream, item: TokenStream) -> TokenStream {
111
111
#fn_call
112
112
} ) ;
113
113
114
- * ANYRUN_INTERNAL_THREAD . lock( ) . unwrap( ) = Some ( ( handle, current_id) ) ;
114
+ * ANYRUN_INTERNAL_THREAD . lock( ) . unwrap( ) = :: core :: option :: Option :: Some ( ( handle, current_id) ) ;
115
115
116
116
current_id
117
117
}
@@ -177,8 +177,8 @@ pub fn init(_attr: TokenStream, item: TokenStream) -> TokenStream {
177
177
#[ :: abi_stable:: sabi_extern_fn]
178
178
fn anyrun_internal_poll_matches( id: u64 ) -> :: anyrun_plugin:: anyrun_interface:: PollResult {
179
179
match ANYRUN_INTERNAL_THREAD . try_lock( ) {
180
- Ok ( thread) => match thread. as_ref( ) {
181
- Some ( ( thread, task_id) ) => {
180
+ :: core :: result :: Result :: Ok ( thread) => match thread. as_ref( ) {
181
+ :: core :: option :: Option :: Some ( ( thread, task_id) ) => {
182
182
if * task_id == id {
183
183
if !thread. is_finished( ) {
184
184
return :: anyrun_plugin:: anyrun_interface:: PollResult :: Pending ;
@@ -187,9 +187,9 @@ pub fn init(_attr: TokenStream, item: TokenStream) -> TokenStream {
187
187
return :: anyrun_plugin:: anyrun_interface:: PollResult :: Cancelled ;
188
188
}
189
189
}
190
- None => return :: anyrun_plugin:: anyrun_interface:: PollResult :: Cancelled ,
190
+ :: core :: option :: Option :: None => return :: anyrun_plugin:: anyrun_interface:: PollResult :: Cancelled ,
191
191
} ,
192
- Err ( _) => return :: anyrun_plugin:: anyrun_interface:: PollResult :: Pending ,
192
+ :: core :: result :: Result :: Err ( _) => return :: anyrun_plugin:: anyrun_interface:: PollResult :: Pending ,
193
193
}
194
194
195
195
let ( thread, _) = ANYRUN_INTERNAL_THREAD . lock( ) . unwrap( ) . take( ) . unwrap( ) ;
@@ -202,7 +202,7 @@ pub fn init(_attr: TokenStream, item: TokenStream) -> TokenStream {
202
202
203
203
:: std:: thread:: spawn( || {
204
204
let mut lock = ANYRUN_INTERNAL_DATA . write( ) . unwrap( ) ;
205
- * lock = Some ( #fn_name( config_dir) ) ;
205
+ * lock = :: core :: option :: Option :: Some ( #fn_name( config_dir) ) ;
206
206
} ) ;
207
207
}
208
208
}
@@ -231,7 +231,7 @@ pub fn config_args(_attr: TokenStream, item: TokenStream) -> TokenStream {
231
231
232
232
operations = quote ! {
233
233
#operations
234
- if let Some ( val) = opt. #ident {
234
+ if let :: core :: option :: Option :: Some ( val) = opt. #ident {
235
235
self . #ident = val;
236
236
}
237
237
}
0 commit comments