From 84f61d17da9c68992de69257e444ef92e20eb7cd Mon Sep 17 00:00:00 2001 From: Adam Chalmers Date: Tue, 19 Dec 2023 23:09:50 -0600 Subject: [PATCH] More comments --- execution-plan-macros/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/execution-plan-macros/src/lib.rs b/execution-plan-macros/src/lib.rs index 77f8d739..6aeb1169 100644 --- a/execution-plan-macros/src/lib.rs +++ b/execution-plan-macros/src/lib.rs @@ -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. @@ -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