Skip to content

Commit 4f550c3

Browse files
committed
fix(stackable-versioned): Finish error accumulator
This uses correct error handling by letting the error accumulator handle the fallible function. Previously, this panicked, because the accumulator was dropped without being finished.
1 parent 31818a7 commit 4f550c3

File tree

1 file changed

+10
-4
lines changed
  • crates/stackable-versioned-macros/src/codegen

1 file changed

+10
-4
lines changed

crates/stackable-versioned-macros/src/codegen/module.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,18 @@ impl Module {
6060
for item in items {
6161
match item {
6262
Item::Enum(item_enum) => {
63-
let container = Container::new_enum_nested(item_enum, &versions)?;
64-
containers.push(container);
63+
if let Some(container) =
64+
errors.handle(Container::new_enum_nested(item_enum, &versions))
65+
{
66+
containers.push(container);
67+
};
6568
}
6669
Item::Struct(item_struct) => {
67-
let container = Container::new_struct_nested(item_struct, &versions)?;
68-
containers.push(container);
70+
if let Some(container) =
71+
errors.handle(Container::new_struct_nested(item_struct, &versions))
72+
{
73+
containers.push(container);
74+
}
6975
}
7076
Item::Mod(submodule) => {
7177
if !versions

0 commit comments

Comments
 (0)