@@ -167,12 +167,6 @@ impl BytecodeDependencyCollector<'_> {
167
167
}
168
168
169
169
impl Visitor for BytecodeDependencyCollector < ' _ > {
170
- fn visit_new_expression ( & mut self , expr : & NewExpression ) {
171
- if let TypeName :: UserDefinedTypeName ( _) = & expr. type_name {
172
- self . total_count += 1 ;
173
- }
174
- }
175
-
176
170
fn visit_function_call ( & mut self , call : & FunctionCall ) {
177
171
let ( new_loc, expr) = match & call. expression {
178
172
Expression :: NewExpression ( expr) => ( expr. src , expr) ,
@@ -200,6 +194,12 @@ impl Visitor for BytecodeDependencyCollector<'_> {
200
194
} ) ;
201
195
}
202
196
197
+ fn visit_new_expression ( & mut self , expr : & NewExpression ) {
198
+ if let TypeName :: UserDefinedTypeName ( _) = & expr. type_name {
199
+ self . total_count += 1 ;
200
+ }
201
+ }
202
+
203
203
fn visit_member_access ( & mut self , access : & MemberAccess ) {
204
204
if access. member_name != "creationCode" {
205
205
return ;
@@ -305,7 +305,7 @@ impl ContractData<'_> {
305
305
let abi_encode_args =
306
306
params. parameters . iter ( ) . map ( |param| format ! ( "args.{}" , param. name) ) . join ( ", " ) ;
307
307
308
- let vm_interface_name = format ! ( "VmContractHelper{}" , ast_id ) ;
308
+ let vm_interface_name = format ! ( "VmContractHelper{ast_id}" ) ;
309
309
let vm = format ! ( "{vm_interface_name}(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D)" ) ;
310
310
311
311
let helper = format ! (
@@ -380,7 +380,7 @@ impl BytecodeDependencyOptimizer<'_> {
380
380
for ( path, ast) in & self . asts {
381
381
let src = self . sources . get ( path) . unwrap ( ) . content . as_str ( ) ;
382
382
383
- if is_test_or_script ( path, & self . paths ) {
383
+ if is_test_or_script ( path, self . paths ) {
384
384
continue ;
385
385
}
386
386
@@ -428,7 +428,7 @@ impl BytecodeDependencyOptimizer<'_> {
428
428
let mut new_sources = Sources :: new ( ) ;
429
429
for ( id, contract) in contracts {
430
430
if let Some ( code) = contract. build_helper ( ) ? {
431
- let path = format ! ( "foundry-pp/DeployHelper{}.sol" , id ) ;
431
+ let path = format ! ( "foundry-pp/DeployHelper{id }.sol" ) ;
432
432
new_sources. insert ( path. into ( ) , Source :: new ( code) ) ;
433
433
}
434
434
}
@@ -444,7 +444,7 @@ impl BytecodeDependencyOptimizer<'_> {
444
444
updates : & mut Updates ,
445
445
) -> Result < ( ) > {
446
446
for ( path, ast) in & self . asts {
447
- if !is_test_or_script ( path, & self . paths ) {
447
+ if !is_test_or_script ( path, self . paths ) {
448
448
continue ;
449
449
}
450
450
let src = self . sources . get ( path) . unwrap ( ) . content . as_str ( ) ;
0 commit comments