@@ -275,7 +275,7 @@ pub(super) fn expand(cx: &mut ExpCtxt<'_>, contract: &ItemContract) -> Result<To
275
275
\n \
276
276
See the [module-level documentation](self) for all the available methods."
277
277
) ;
278
- let ( deploy_fn, deploy_method) = option_unzip ( bytecode. is_some ( ) . then ( || {
278
+ let ( deploy_fn, deploy_method) = bytecode. is_some ( ) . then ( || {
279
279
let deploy_doc_str =
280
280
"Deploys this contract using the given `provider` and constructor arguments, if any.\n \
281
281
\n \
@@ -292,7 +292,7 @@ pub(super) fn expand(cx: &mut ExpCtxt<'_>, contract: &ItemContract) -> Result<To
292
292
the bytecode concatenated with the constructor's ABI-encoded arguments.";
293
293
let deploy_builder_doc = mk_doc ( deploy_builder_doc_str) ;
294
294
295
- let ( params, args) = option_unzip ( constructor. and_then ( |c| {
295
+ let ( params, args) = constructor. and_then ( |c| {
296
296
if c. parameters . is_empty ( ) {
297
297
return None ;
298
298
}
@@ -303,7 +303,7 @@ pub(super) fn expand(cx: &mut ExpCtxt<'_>, contract: &ItemContract) -> Result<To
303
303
super :: ty:: expand_rust_type ( ty, & cx. crates )
304
304
} ) ;
305
305
Some ( ( quote ! ( #( #names1: #tys) , * ) , quote ! ( #( #names2, ) * ) ) )
306
- } ) ) ;
306
+ } ) . unzip ( ) ;
307
307
let deploy_builder_data = if matches ! ( constructor, Some ( c) if !c. parameters. is_empty( ) ) {
308
308
quote ! {
309
309
[
@@ -355,7 +355,7 @@ pub(super) fn expand(cx: &mut ExpCtxt<'_>, contract: &ItemContract) -> Result<To
355
355
}
356
356
} ,
357
357
)
358
- } ) ) ;
358
+ } ) . unzip ( ) ;
359
359
360
360
let filter_methods = events. iter ( ) . map ( |& e| {
361
361
let event_name = cx. overloaded_name ( e. into ( ) ) ;
@@ -1014,11 +1014,3 @@ fn snakify(s: &str) -> String {
1014
1014
}
1015
1015
output. into_iter ( ) . collect ( )
1016
1016
}
1017
-
1018
- // TODO(MSRV-1.66): Option::unzip
1019
- fn option_unzip < T , U > ( opt : Option < ( T , U ) > ) -> ( Option < T > , Option < U > ) {
1020
- match opt {
1021
- Some ( ( a, b) ) => ( Some ( a) , Some ( b) ) ,
1022
- None => ( None , None ) ,
1023
- }
1024
- }
0 commit comments