@@ -190,7 +190,8 @@ impl AccountStatesVerifier {
190
190
. 0
191
191
. addresses
192
192
. iter ( )
193
- . filter ( |& x| filter_accounts ( x) ) . cloned ( )
193
+ . filter ( |& x| filter_accounts ( x) )
194
+ . cloned ( )
194
195
. map ( |x| find_equal_and_sub ( x, inputs) )
195
196
. collect ( ) ;
196
197
@@ -231,7 +232,8 @@ impl AccountStatesVerifier {
231
232
fn find_equal_and_sub ( x : AddressDataValue , collection : & [ AddressDataValue ] ) -> AddressDataValue {
232
233
match collection
233
234
. iter ( )
234
- . find ( |& y| y. address_data == x. address_data ) . cloned ( )
235
+ . find ( |& y| y. address_data == x. address_data )
236
+ . cloned ( )
235
237
{
236
238
Some ( y) => AddressDataValue :: new ( x. address_data , ( x. value - y. value ) . unwrap ( ) ) ,
237
239
None => x,
@@ -241,7 +243,8 @@ fn find_equal_and_sub(x: AddressDataValue, collection: &[AddressDataValue]) -> A
241
243
fn find_equal_and_add ( x : AddressDataValue , collection : & [ AddressDataValue ] ) -> AddressDataValue {
242
244
match collection
243
245
. iter ( )
244
- . find ( |& y| y. address_data == x. address_data ) . cloned ( )
246
+ . find ( |& y| y. address_data == x. address_data )
247
+ . cloned ( )
245
248
{
246
249
Some ( y) => AddressDataValue :: new ( x. address_data , ( x. value + y. value ) . unwrap ( ) ) ,
247
250
None => x,
@@ -265,20 +268,23 @@ impl UtxoVerifier {
265
268
pub fn new ( transaction_data : ArbitraryValidTransactionData ) -> Self {
266
269
UtxoVerifier ( transaction_data)
267
270
}
268
-
271
+ # [ allow ( clippy :: iter_overeager_cloned ) ]
269
272
pub fn calculate_current_utxo ( & self ) -> Vec < AddressDataValue > {
270
273
let inputs = & self . 0 . input_addresses ;
271
274
let all = & self . 0 . addresses ;
272
275
let outputs = & self . 0 . output_addresses ;
273
276
274
277
let utxo_not_changed: Vec < AddressDataValue > = all
275
278
. iter ( )
279
+ . filter ( |& x| filter_utxo ( x) )
276
280
. cloned ( )
277
- . filter ( filter_utxo)
278
281
. filter ( |x| !inputs. contains ( x) )
279
282
. collect ( ) ;
280
- let utxo_added: Vec < AddressDataValue > =
281
- outputs. iter ( ) . cloned ( ) . filter ( filter_utxo) . collect ( ) ;
283
+ let utxo_added: Vec < AddressDataValue > = outputs
284
+ . iter ( )
285
+ . filter ( |& x| filter_utxo ( x) )
286
+ . cloned ( )
287
+ . collect ( ) ;
282
288
283
289
let mut snapshot = Vec :: new ( ) ;
284
290
snapshot. extend ( utxo_not_changed) ;
0 commit comments