File tree Expand file tree Collapse file tree 1 file changed +0
-15
lines changed
crates/stackable-versioned-macros/src Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Original file line number Diff line number Diff line change @@ -483,26 +483,11 @@ println!("{}", serde_yaml::to_string(&merged_crd).unwrap());
483
483
/// a cluster scoped.
484
484
#[ proc_macro_attribute]
485
485
pub fn versioned ( attrs : TokenStream , input : TokenStream ) -> TokenStream {
486
- // NOTE (@Techassi): For now, we can just use the DeriveInput type here,
487
- // because we only support structs end enums to be versioned.
488
- // In the future - if we decide to support modules - this requires
489
- // adjustments to also support modules. One possible solution might be to
490
- // use an enum with two variants: Container(DeriveInput) and
491
- // Module(ItemMod).
492
486
let input = syn:: parse_macro_input!( input as Item ) ;
493
487
versioned_impl ( attrs. into ( ) , input) . into ( )
494
488
}
495
489
496
490
fn versioned_impl ( attrs : proc_macro2:: TokenStream , input : Item ) -> proc_macro2:: TokenStream {
497
- // NOTE (@Techassi): This derive macro cannot handle multiple structs / enums
498
- // to be versioned within the same file. This is because we cannot declare
499
- // modules more than once (They will not be merged, like impl blocks for
500
- // example). This leads to collisions if there are multiple structs / enums
501
- // which declare the same version. This could maybe be solved by using an
502
- // attribute macro applied to a module with all struct / enums declared in said
503
- // module. This would allow us to generate all versioned structs and enums in
504
- // a single sweep and put them into the appropriate module.
505
-
506
491
// TODO (@Techassi): Think about how we can handle nested structs / enums which
507
492
// are also versioned.
508
493
You can’t perform that action at this time.
0 commit comments