From 43172b1c4638145ed6664727650843c0f3aa5086 Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Mon, 26 Aug 2024 14:20:06 +0300 Subject: [PATCH] PR comments on naming --- fuel-asm/derive/src/codegen.rs | 2 +- fuel-asm/derive/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fuel-asm/derive/src/codegen.rs b/fuel-asm/derive/src/codegen.rs index 05b685a5fd..509e6f3fd5 100644 --- a/fuel-asm/derive/src/codegen.rs +++ b/fuel-asm/derive/src/codegen.rs @@ -338,7 +338,7 @@ pub fn opcode_try_from(instructions: &InstructionList) -> TokenStream { } } -pub fn from_op(instructions: &InstructionList) -> TokenStream { +pub fn op_conversions(instructions: &InstructionList) -> TokenStream { instructions.map_to_tokens(|Instruction { opcode_name, .. }| { quote! { impl From<#opcode_name> for [u8; 3] { diff --git a/fuel-asm/derive/src/lib.rs b/fuel-asm/derive/src/lib.rs index 89b5f054b1..d4deedfe10 100644 --- a/fuel-asm/derive/src/lib.rs +++ b/fuel-asm/derive/src/lib.rs @@ -217,7 +217,7 @@ pub fn impl_instructions(input: proc_macro::TokenStream) -> proc_macro::TokenStr let op_structs = codegen::op_structs(&instructions); let op_debug_impl = codegen::op_debug_impl(&instructions); - let from_op = codegen::from_op(&instructions); + let op_conversions = codegen::op_conversions(&instructions); let op_constructor_shorthand = codegen::op_constructor_shorthand(&instructions); let op_fn_new = codegen::op_fn_new(&instructions); let op_constructors_typescript = codegen::op_constructors_typescript(&instructions); @@ -241,7 +241,7 @@ pub fn impl_instructions(input: proc_macro::TokenStream) -> proc_macro::TokenStr use super::*; #op_structs #op_debug_impl - #from_op + #op_conversions #op_constructor_shorthand #op_fn_new #op_constructors_typescript