11use clap:: { arg, command, Parser } ;
22use std:: fmt:: Debug ;
3- #[ cfg( feature = "opt " ) ]
3+ #[ cfg( feature = "additional-libs " ) ]
44use wasm_opt:: { Feature , OptimizationError , OptimizationOptions } ;
55
66use crate :: wasm;
@@ -19,21 +19,21 @@ pub struct Cmd {
1919pub enum Error {
2020 #[ error( transparent) ]
2121 Wasm ( #[ from] wasm:: Error ) ,
22- #[ cfg( feature = "opt " ) ]
22+ #[ cfg( feature = "additional-libs " ) ]
2323 #[ error( "optimization error: {0}" ) ]
2424 OptimizationError ( OptimizationError ) ,
25- #[ cfg( not( feature = "opt " ) ) ]
26- #[ error( "Must install with \" opt \" feature, e.g. `cargo install --locked soroban-cli --features opt " ) ]
25+ #[ cfg( not( feature = "additional-libs " ) ) ]
26+ #[ error( "must install with \" additional-libs \" feature. " ) ]
2727 Install ,
2828}
2929
3030impl Cmd {
31- #[ cfg( not( feature = "opt " ) ) ]
31+ #[ cfg( not( feature = "additional-libs " ) ) ]
3232 pub fn run ( & self ) -> Result < ( ) , Error > {
3333 Err ( Error :: Install )
3434 }
3535
36- #[ cfg( feature = "opt " ) ]
36+ #[ cfg( feature = "additional-libs " ) ]
3737 pub fn run ( & self ) -> Result < ( ) , Error > {
3838 let wasm_size = self . wasm . len ( ) ?;
3939
@@ -43,7 +43,7 @@ impl Cmd {
4343 wasm_size
4444 ) ;
4545
46- let wasm_out = self . wasm_out . as_ref ( ) . cloned ( ) . unwrap_or_else ( || {
46+ let wasm_out = self . wasm_out . clone ( ) . unwrap_or_else ( || {
4747 let mut wasm_out = self . wasm . wasm . clone ( ) ;
4848 wasm_out. set_extension ( "optimized.wasm" ) ;
4949 wasm_out
0 commit comments