Skip to content

Comments

Convert errors in Accumulator::handle#421

Open
TedDriggs wants to merge 2 commits intomasterfrom
handle-into
Open

Convert errors in Accumulator::handle#421
TedDriggs wants to merge 2 commits intomasterfrom
handle-into

Conversation

@TedDriggs
Copy link
Owner

@nik-rev @DCNick3 review is welcome

This makes for slightly more concise use of Accumulator::handle by removing the need to do error conversion at the call site.

This is a breaking change for callers who were already calling into on the error path. Two places in generated code were broken as a result of the change, so the first commit fixes those to avoid the error.

Fixes #252

Previously, this was using darling::export::Ok, which meant the type of `E` was unspecified.
Switching to `darling::Result::Ok` is equivalent.
This makes for slightly more concise use of Accumulator::handle by removing the need to do error conversion at the call site.

This is a breaking change for callers who were already calling `into` on the error path.

Fixes #252
@@ -828,12 +828,13 @@ impl Accumulator {

/// Handles a possible error.
Copy link
Contributor

@nik-rev nik-rev Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a more concise doc for this function could be:

/// Extracts the `Ok` value, otherwise handles the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert errors in Accumulator::handle

2 participants