@@ -178,7 +178,6 @@ pub struct TransactionBuilderConfigBuilder {
178178
179179#[ wasm_bindgen]
180180impl TransactionBuilderConfigBuilder {
181-
182181 pub fn new ( ) -> Self {
183182 Self {
184183 fee_algo : None ,
@@ -191,50 +190,49 @@ impl TransactionBuilderConfigBuilder {
191190 }
192191 }
193192
194- pub fn fee_algo ( & mut self , fee_algo : fees:: LinearFee ) -> Self {
193+ pub fn fee_algo ( mut self , fee_algo : fees:: LinearFee ) -> Self {
195194 self . fee_algo = Some ( fee_algo) ;
196- self . clone ( )
195+ self
197196 }
198197
199- pub fn pool_deposit ( & mut self , pool_deposit : BigNum ) -> Self {
198+ pub fn pool_deposit ( mut self , pool_deposit : BigNum ) -> Self {
200199 self . pool_deposit = Some ( pool_deposit) ;
201- self . clone ( )
200+ self
202201 }
203202
204- pub fn key_deposit ( & mut self , key_deposit : BigNum ) -> Self {
203+ pub fn key_deposit ( mut self , key_deposit : BigNum ) -> Self {
205204 self . key_deposit = Some ( key_deposit) ;
206- self . clone ( )
205+ self
207206 }
208207
209- pub fn max_value_size ( & mut self , max_value_size : u32 ) -> Self {
208+ pub fn max_value_size ( mut self , max_value_size : u32 ) -> Self {
210209 self . max_value_size = Some ( max_value_size) ;
211- self . clone ( )
210+ self
212211 }
213212
214- pub fn max_tx_size ( & mut self , max_tx_size : u32 ) -> Self {
213+ pub fn max_tx_size ( mut self , max_tx_size : u32 ) -> Self {
215214 self . max_tx_size = Some ( max_tx_size) ;
216- self . clone ( )
215+ self
217216 }
218217
219- pub fn coins_per_utxo_word ( & mut self , coins_per_utxo_word : Coin ) -> Self {
218+ pub fn coins_per_utxo_word ( mut self , coins_per_utxo_word : Coin ) -> Self {
220219 self . coins_per_utxo_word = Some ( coins_per_utxo_word) ;
221- self . clone ( )
220+ self
222221 }
223222
224- pub fn prefer_pure_change ( & mut self , prefer_pure_change : bool ) -> Self {
223+ pub fn prefer_pure_change ( mut self , prefer_pure_change : bool ) -> Self {
225224 self . prefer_pure_change = prefer_pure_change;
226- self . clone ( )
225+ self
227226 }
228227
229- pub fn build ( & self ) -> Result < TransactionBuilderConfig , JsError > {
230- let cfg = self . clone ( ) ;
228+ pub fn build ( self ) -> Result < TransactionBuilderConfig , JsError > {
231229 Ok ( TransactionBuilderConfig {
232- fee_algo : cfg . fee_algo . ok_or ( JsError :: from_str ( "uninitialized field: fee_algo" ) ) ?,
233- pool_deposit : cfg . pool_deposit . ok_or ( JsError :: from_str ( "uninitialized field: pool_deposit" ) ) ?,
234- key_deposit : cfg . key_deposit . ok_or ( JsError :: from_str ( "uninitialized field: key_deposit" ) ) ?,
235- max_value_size : cfg . max_value_size . ok_or ( JsError :: from_str ( "uninitialized field: max_value_size" ) ) ?,
236- max_tx_size : cfg . max_tx_size . ok_or ( JsError :: from_str ( "uninitialized field: max_tx_size" ) ) ?,
237- coins_per_utxo_word : cfg . coins_per_utxo_word . ok_or ( JsError :: from_str ( "uninitialized field: coins_per_utxo_word" ) ) ?,
230+ fee_algo : self . fee_algo . ok_or ( JsError :: from_str ( "uninitialized field: fee_algo" ) ) ?,
231+ pool_deposit : self . pool_deposit . ok_or ( JsError :: from_str ( "uninitialized field: pool_deposit" ) ) ?,
232+ key_deposit : self . key_deposit . ok_or ( JsError :: from_str ( "uninitialized field: key_deposit" ) ) ?,
233+ max_value_size : self . max_value_size . ok_or ( JsError :: from_str ( "uninitialized field: max_value_size" ) ) ?,
234+ max_tx_size : self . max_tx_size . ok_or ( JsError :: from_str ( "uninitialized field: max_tx_size" ) ) ?,
235+ coins_per_utxo_word : self . coins_per_utxo_word . ok_or ( JsError :: from_str ( "uninitialized field: coins_per_utxo_word" ) ) ?,
238236 prefer_pure_change : self . prefer_pure_change ,
239237 } )
240238 }
0 commit comments