Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
segfault-magnet committed Oct 9, 2023
1 parent d911b09 commit 720242f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn enum_decl(
let maybe_disable_std = no_std.then(|| quote! {#[NoStd]});

let enum_variants = components.as_enum_variants();
let unused_generics_variant = components.variant_for_unused_generics(generics);
let unused_generics_variant = components.generate_variant_for_unused_generics(generics);
let (_, generics_w_bounds) = tokenize_generics(generics);

quote! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ fn struct_decl(

let (generics_wo_bounds, generics_w_bounds) = tokenize_generics(generics);
let (field_names, field_types): (Vec<_>, Vec<_>) = components.iter().unzip();
let (phantom_fields, phantom_types) = components.parameters_for_unused_generics(generics);
let (phantom_fields, phantom_types) =
components.generate_parameters_for_unused_generics(generics);

quote! {
#[derive(
Expand Down
7 changes: 5 additions & 2 deletions packages/fuels-code-gen/src/program_bindings/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Components {
})
}

pub fn parameters_for_unused_generics(
pub fn generate_parameters_for_unused_generics(
&self,
declared_generics: &[Ident],
) -> (Vec<Ident>, Vec<TokenStream>) {
Expand All @@ -75,7 +75,10 @@ impl Components {
.unzip()
}

pub fn variant_for_unused_generics(&self, declared_generics: &[Ident]) -> Option<TokenStream> {
pub fn generate_variant_for_unused_generics(
&self,
declared_generics: &[Ident],
) -> Option<TokenStream> {
let phantom_types = self
.unused_named_generics(declared_generics)
.map(|generic| {
Expand Down

0 comments on commit 720242f

Please sign in to comment.