Skip to content

Commit 855303a

Browse files
committed
🎨 Fix clippy.
1 parent 3cddd60 commit 855303a

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

src/tools/derive_enum_items.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ impl Parse for DeriveEnumItems {
6262
content
6363
};
6464

65-
tuple.push((StructType::InlineEnum(content), ExtraTypeWrapper::Vec));
65+
tuple.push((
66+
StructType::InlineEnum(Box::new(content)),
67+
ExtraTypeWrapper::Vec,
68+
));
6669
} else {
6770
// Ident([Ident { ... }], ...),
6871
// Ident([{ ... }], ...),
@@ -78,7 +81,10 @@ impl Parse for DeriveEnumItems {
7881
content
7982
};
8083

81-
tuple.push((StructType::InlineStruct(content), ExtraTypeWrapper::Vec));
84+
tuple.push((
85+
StructType::InlineStruct(Box::new(content)),
86+
ExtraTypeWrapper::Vec,
87+
));
8288
}
8389
} else if sub_content.peek(Token![enum]) {
8490
// Ident(enum Ident { ... }, ...),
@@ -94,7 +100,10 @@ impl Parse for DeriveEnumItems {
94100
content
95101
};
96102

97-
tuple.push((StructType::InlineEnum(content), ExtraTypeWrapper::Default));
103+
tuple.push((
104+
StructType::InlineEnum(Box::new(content)),
105+
ExtraTypeWrapper::Default,
106+
));
98107
} else if sub_content.peek2(token::Brace) {
99108
// Ident(Ident { ... }, ...),
100109
// Ident({ ... }, ...),
@@ -109,7 +118,10 @@ impl Parse for DeriveEnumItems {
109118
content
110119
};
111120

112-
tuple.push((StructType::InlineStruct(content), ExtraTypeWrapper::Default));
121+
tuple.push((
122+
StructType::InlineStruct(Box::new(content)),
123+
ExtraTypeWrapper::Default,
124+
));
113125
} else {
114126
// Ident (TypePath, ...),
115127
let ty: TypePath = sub_content.parse()?;

src/tools/derive_struct_items.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl Parse for DeriveStructItems {
5353

5454
own_struct.push((
5555
key,
56-
StructType::InlineEnum(content),
56+
StructType::InlineEnum(Box::new(content)),
5757
if optional {
5858
ExtraTypeWrapper::OptionVec
5959
} else {
@@ -105,7 +105,7 @@ impl Parse for DeriveStructItems {
105105

106106
own_struct.push((
107107
key,
108-
StructType::InlineStruct(content),
108+
StructType::InlineStruct(Box::new(content)),
109109
if optional {
110110
ExtraTypeWrapper::OptionVec
111111
} else {
@@ -158,7 +158,7 @@ impl Parse for DeriveStructItems {
158158

159159
own_struct.push((
160160
key.clone(),
161-
StructType::InlineEnum(content),
161+
StructType::InlineEnum(Box::new(content)),
162162
if optional {
163163
ExtraTypeWrapper::Option
164164
} else {
@@ -189,7 +189,7 @@ impl Parse for DeriveStructItems {
189189

190190
own_struct.push((
191191
key.clone(),
192-
StructType::InlineStruct(content),
192+
StructType::InlineStruct(Box::new(content)),
193193
if optional {
194194
ExtraTypeWrapper::Option
195195
} else {

src/tools/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ impl StructName {
7777
#[derive(Debug, Clone)]
7878
pub(crate) enum StructType {
7979
Static(TypePath),
80-
InlineStruct(DeriveStruct),
81-
InlineEnum(DeriveEnum),
80+
InlineStruct(Box<DeriveStruct>),
81+
InlineEnum(Box<DeriveEnum>),
8282
}
8383

8484
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)