Repository: huff-language/huff-rs
Pull request #270 (2023-04-04 21:43:18)

fix(cg): fix merge issue 
## Overview
Fixes merge issue



Patch:
diff --git a/huff_codegen/src/irgen/arg_calls.rs b/huff_codegen/src/irgen/arg_calls.rs
index 61758f4..09e8162 100644
--- a/huff_codegen/src/irgen/arg_calls.rs
+++ b/huff_codegen/src/irgen/arg_calls.rs
@@ -67,9 +67,10 @@ pub fn bubble_arg_call(
                             }
                         };
                         let mis_len = mis.len();
+                        let ac_ = &ac.to_string();
                         return if last_mi.1.macro_name.eq(&macro_def.name) {
                             bubble_arg_call(
-                                ac,
+                                ac_,
                                 bytes,
                                 bubbled_macro_invocation,
                                 contract,
@@ -80,7 +81,7 @@ pub fn bubble_arg_call(
                             )
                         } else {
                             bubble_arg_call(
-                                &ac.to_string(),
+                                ac_,
                                 bytes,
                                 bubbled_macro_invocation,
                                 contract,


Test patch:
diff --git a/huff_core/tests/macro_invoc_args.rs b/huff_core/tests/macro_invoc_args.rs
index 5384d56..ab11f55 100644
--- a/huff_core/tests/macro_invoc_args.rs
+++ b/huff_core/tests/macro_invoc_args.rs
@@ -261,10 +261,9 @@ fn test_bubbled_constant_macro_arg() {
     assert_eq!(bytecode.to_lowercase(), expected_bytecode.to_lowercase());
 }
 
-
 #[test]
 fn test_bubbled_arg_with_different_name() {
-  let source = r#"
+    let source = r#"
           #define macro MACRO_A(arg_a) = takes(0) returns(0) {
             <arg_a>
           }
@@ -276,21 +275,20 @@ fn test_bubbled_arg_with_different_name() {
           }
       "#;
 
-  // Lex + Parse
-  let flattened_source = FullFileSource { source, file: None, spans: vec![] };
-  let lexer = Lexer::new(flattened_source);
-  let tokens = lexer.into_iter().map(|x| x.unwrap()).collect::<Vec<Token>>();
-  let mut parser = Parser::new(tokens, None);
-  let mut contract = parser.parse().unwrap();
-  contract.derive_storage_pointers();
-
-  // Create main and constructor bytecode
-  let main_bytecode = Codegen::generate_main_bytecode(&contract, None).unwrap();
+    // Lex + Parse
+    let flattened_source = FullFileSource { source, file: None, spans: vec![] };
+    let lexer = Lexer::new(flattened_source.source);
+    let tokens = lexer.into_iter().map(|x| x.unwrap()).collect::<Vec<Token>>();
+    let mut parser = Parser::new(tokens, None);
+    let mut contract = parser.parse().unwrap();
+    contract.derive_storage_pointers();
 
-  // Full expected bytecode output (generated from huffc) (placed here as a reference)
-  let expected_bytecode = "6001";
+    // Create main and constructor bytecode
+    let main_bytecode = Codegen::generate_main_bytecode(&contract, None).unwrap();
 
-  // Check the bytecode
-  assert_eq!(main_bytecode, expected_bytecode);
+    // Full expected bytecode output (generated from huffc) (placed here as a reference)
+    let expected_bytecode = "6001";
 
-}
\ No newline at end of file
+    // Check the bytecode
+    assert_eq!(main_bytecode, expected_bytecode);
+}