@@ -666,7 +666,7 @@ mod tests {
666666 // - Include tx priority=10: remaining = 30-10 = 20 >= 15 ok
667667 // - Include tx priority=5: remaining = 20-10 = 10 < 15 stop
668668 // Threshold = 10 (the last included tx's fee)
669- let txs = vec ! [ tx( 10 , 10 ) , tx( 5 , 10 ) , tx( 2 , 10 ) ] ;
669+ let txs = [ tx ( 10 , 10 ) , tx ( 5 , 10 ) , tx ( 2 , 10 ) ] ;
670670 let txs_refs: Vec < & MeteredTransaction > = txs. iter ( ) . collect ( ) ;
671671 let quote = compute_estimate (
672672 ResourceKind :: GasUsed ,
@@ -688,7 +688,7 @@ mod tests {
688688 fn compute_estimate_uncongested_resource ( ) {
689689 // Limit: 100, Demand: 15
690690 // All transactions fit with room to spare -> return default fee
691- let txs = vec ! [ tx( 10 , 10 ) , tx( 5 , 10 ) , tx( 2 , 10 ) ] ;
691+ let txs = [ tx ( 10 , 10 ) , tx ( 5 , 10 ) , tx ( 2 , 10 ) ] ;
692692 let txs_refs: Vec < & MeteredTransaction > = txs. iter ( ) . collect ( ) ;
693693 let quote = compute_estimate (
694694 ResourceKind :: GasUsed ,
@@ -709,7 +709,7 @@ mod tests {
709709 #[ test]
710710 fn compute_estimate_demand_exceeds_limit ( ) {
711711 // Demand > Limit -> Error
712- let txs = vec ! [ tx( 10 , 10 ) , tx( 5 , 10 ) ] ;
712+ let txs = [ tx ( 10 , 10 ) , tx ( 5 , 10 ) ] ;
713713 let txs_refs: Vec < & MeteredTransaction > = txs. iter ( ) . collect ( ) ;
714714 let result = compute_estimate (
715715 ResourceKind :: GasUsed ,
@@ -736,7 +736,7 @@ mod tests {
736736 // Transactions: priority=10 (10 gas), priority=5 (10 gas)
737737 // After including tx priority=10: remaining = 20 >= 20 ok
738738 // After including tx priority=5: remaining = 10 < 20 stop
739- let txs = vec ! [ tx( 10 , 10 ) , tx( 5 , 10 ) ] ;
739+ let txs = [ tx ( 10 , 10 ) , tx ( 5 , 10 ) ] ;
740740 let txs_refs: Vec < & MeteredTransaction > = txs. iter ( ) . collect ( ) ;
741741 let quote = compute_estimate (
742742 ResourceKind :: GasUsed ,
@@ -756,7 +756,7 @@ mod tests {
756756 #[ test]
757757 fn compute_estimate_single_transaction ( ) {
758758 // Single tx that fits
759- let txs = vec ! [ tx( 10 , 10 ) ] ;
759+ let txs = [ tx ( 10 , 10 ) ] ;
760760 let txs_refs: Vec < & MeteredTransaction > = txs. iter ( ) . collect ( ) ;
761761 let quote = compute_estimate (
762762 ResourceKind :: GasUsed ,
@@ -778,7 +778,7 @@ mod tests {
778778 fn compute_estimate_no_room_for_any_tx ( ) {
779779 // Limit: 25, Demand: 20
780780 // First tx uses 10, remaining = 15 < 20 -> can't even include first tx
781- let txs = vec ! [ tx( 10 , 10 ) , tx( 5 , 10 ) ] ;
781+ let txs = [ tx ( 10 , 10 ) , tx ( 5 , 10 ) ] ;
782782 let txs_refs: Vec < & MeteredTransaction > = txs. iter ( ) . collect ( ) ;
783783 let quote = compute_estimate (
784784 ResourceKind :: GasUsed ,
@@ -858,8 +858,7 @@ mod tests {
858858 guard. push_transaction ( 1 , 0 , tx ( 10 , 10 ) ) ;
859859 guard. push_transaction ( 1 , 0 , tx ( 5 , 10 ) ) ;
860860 }
861- let mut demand = ResourceDemand :: default ( ) ;
862- demand. gas_used = Some ( 15 ) ;
861+ let demand = ResourceDemand { gas_used : Some ( 15 ) , ..Default :: default ( ) } ;
863862
864863 let err = estimator
865864 . estimate_for_block ( Some ( 1 ) , demand)
@@ -887,8 +886,7 @@ mod tests {
887886 guard. push_transaction ( 2 , 0 , tx ( 25 , 10 ) ) ;
888887 }
889888
890- let mut demand = ResourceDemand :: default ( ) ;
891- demand. gas_used = Some ( 15 ) ;
889+ let demand = ResourceDemand { gas_used : Some ( 15 ) , ..Default :: default ( ) } ;
892890
893891 let rolling =
894892 estimator. estimate_rolling ( demand) . expect ( "no error" ) . expect ( "estimates available" ) ;
0 commit comments