Skip to content

Commit

Permalink
More comments
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchalmers committed Dec 20, 2023
1 parent c8681f5 commit 84f61d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions execution-plan-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ fn impl_value_on_struct(
};
};

// We're going to construct some fragments of Rust source code, which will get used in the
// final generated code this function returns.

// For every field in the struct, this macro will:
// - In the `into_parts`, extend the Vec of parts with that field, turned into parts.
// - In the `from_parts`, instantiate a Self with a field from that part.
Expand Down Expand Up @@ -68,6 +71,8 @@ fn impl_value_on_struct(
}
let where_clause = generics.where_clause;

// Final return value: the generated Rust code to implement the trait.
// This uses the fragments above, interpolating them into the final outputted code.
quote! {
impl #generics_without_defaults kittycad_execution_plan_traits::Value for #name #generics_without_defaults
#where_clause
Expand Down

0 comments on commit 84f61d1

Please sign in to comment.