@@ -5,12 +5,12 @@ use serde::Serialize;
55#[ clap( next_help_heading = "Resolc configuration" ) ]
66/// Compiler options for resolc
77pub struct ResolcOpts {
8- #[ clap (
8+ #[ arg (
99 value_name = "RESOLC_COMPILE" ,
1010 help = "Enable compiling with resolc" ,
1111 long = "resolc-compile" ,
1212 visible_alias = "resolc" ,
13- action = clap:: ArgAction :: SetTrue ,
13+ action = clap:: ArgAction :: SetTrue
1414 ) ]
1515 pub resolc_compile : Option < bool > ,
1616
@@ -29,7 +29,7 @@ pub struct ResolcOpts {
2929
3030 /// Set the LLVM optimization parameter `-O[0 | 1 | 2 | 3 | s | z]`.
3131 /// Use `3` for best performance and `z` for minimal size.
32- #[ clap (
32+ #[ arg (
3333 short = 'O' ,
3434 long = "resolc-optimizer-mode" ,
3535 help = "Set the resolc optimization mode `-O[0 | 1 | 2 | 3 | s | z]`" ,
@@ -40,12 +40,12 @@ pub struct ResolcOpts {
4040 pub optimizer_mode : Option < String > ,
4141
4242 /// The emulated EVM linear heap memory static buffer size in bytes.
43- #[ clap ( long = "heap-size" , help = "Set the contracts heap size in bytes" , value_name = "SIZE" ) ]
43+ #[ arg ( long = "heap-size" , help = "Set the contracts heap size in bytes" , value_name = "SIZE" ) ]
4444 #[ serde( skip_serializing_if = "Option::is_none" ) ]
4545 pub heap_size : Option < u32 > ,
4646
4747 /// The contracts total stack size in bytes.
48- #[ clap (
48+ #[ arg (
4949 long = "stack-size" ,
5050 help = "Set the contracts total stack size in bytes" ,
5151 value_name = "SIZE"
@@ -64,12 +64,14 @@ impl ResolcOpts {
6464 } ;
6565 }
6666
67+ set_if_some ! (
68+ self . resolc_compile. and_then( |v| if v { Some ( true ) } else { None } ) ,
69+ resolc. resolc_compile
70+ ) ;
6771 set_if_some ! (
6872 self . use_resolc. as_ref( ) . map( |v| SolcReq :: from( v. trim_start_matches( "resolc:" ) ) ) ,
6973 resolc. resolc
7074 ) ;
71-
72- set_if_some ! ( self . resolc_compile, resolc. resolc_compile) ;
7375 set_if_some ! (
7476 self . optimizer_mode. as_ref( ) . and_then( |mode| mode. parse:: <char >( ) . ok( ) ) ,
7577 resolc. optimizer_mode
0 commit comments