Skip to content

Commit 1bffb6a

Browse files
Box large enum variants, as per new clippy lint (#1277)
1 parent 723ba1e commit 1bffb6a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

crates/cxx-qt-build/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl GeneratedCpp {
132132
}
133133
found_bridge = true;
134134

135-
let parser = Parser::from(m.clone())
135+
let parser = Parser::from(*m.clone())
136136
.map_err(GeneratedError::from)
137137
.map_err(to_diagnostic)?;
138138
let generated_cpp = GeneratedCppBlocks::from(&parser, &cxx_qt_opt)

crates/cxx-qt-gen/src/parser/trait_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::{parser::constructor::Constructor, syntax::path::path_compare_str};
1111
#[derive(Debug, PartialEq, Eq)]
1212
pub enum TraitKind {
1313
Threading,
14-
Constructor(Constructor),
14+
Constructor(Box<Constructor>),
1515
}
1616

1717
impl TraitKind {
@@ -33,7 +33,7 @@ impl TraitKind {
3333

3434
fn parse_constructor(imp: &ItemImpl) -> Result<Self> {
3535
let constructor = Constructor::parse(imp.clone())?;
36-
Ok(Self::Constructor(constructor))
36+
Ok(Self::Constructor(Box::new(constructor)))
3737
}
3838

3939
fn parse(imp: &ItemImpl) -> Result<Self> {

crates/cxx-qt-gen/src/syntax/qtitem.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use syn::{Attribute, Item, ItemMod, Result, Token, Visibility};
1313
/// Representation of either a Syn Item, a CXX module, or a CXX-Qt module
1414
pub enum CxxQtItem {
1515
/// A normal syntax item that we pass through
16-
Item(Item),
16+
Item(Box<Item>),
1717
/// A CXX module that we need to generate code for
18-
Cxx(ItemMod),
18+
Cxx(Box<ItemMod>),
1919
/// A CxxQt module block that we need to parse and later generate code for
20-
CxxQt(ItemMod),
20+
CxxQt(Box<ItemMod>),
2121
}
2222

2323
impl std::fmt::Debug for CxxQtItem {

0 commit comments

Comments
 (0)