Skip to content

Commit 01f5245

Browse files
committed
chore: Add generics to Struct struct
1 parent 15faafd commit 01f5245

File tree

1 file changed

+7
-3
lines changed
  • crates/stackable-versioned-macros/src/codegen/container

1 file changed

+7
-3
lines changed

crates/stackable-versioned-macros/src/codegen/container/struct.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::ops::Not;
33
use darling::{util::IdentString, Error, FromAttributes, Result};
44
use proc_macro2::TokenStream;
55
use quote::{quote, ToTokens};
6-
use syn::{parse_quote, ItemStruct, Path, Visibility};
6+
use syn::{parse_quote, Generics, ItemStruct, Path, Visibility};
77

88
use crate::{
99
attrs::container::NestedContainerAttributes,
@@ -58,6 +58,7 @@ impl Container {
5858
};
5959

6060
Ok(Self::Struct(Struct {
61+
generics: item_struct.generics,
6162
fields: versioned_fields,
6263
common,
6364
}))
@@ -113,6 +114,7 @@ impl Container {
113114
};
114115

115116
Ok(Self::Struct(Struct {
117+
generics: item_struct.generics,
116118
fields: versioned_fields,
117119
common,
118120
}))
@@ -123,10 +125,12 @@ impl Container {
123125
pub(crate) struct Struct {
124126
/// List of fields defined in the original struct. How, and if, an item
125127
/// should generate code, is decided by the currently generated version.
126-
pub(crate) fields: Vec<VersionedField>,
128+
pub fields: Vec<VersionedField>,
129+
130+
pub generics: Generics,
127131

128132
/// Common container data which is shared between structs and enums.
129-
pub(crate) common: CommonContainerData,
133+
pub common: CommonContainerData,
130134
}
131135

132136
// Common token generation

0 commit comments

Comments
 (0)