Skip to content

Implement std::error::Error for Error#42

Merged
redstrate merged 1 commit intoredstrate:mainfrom
OhKannaDuh:implement_std_error_for_error
Mar 16, 2026
Merged

Implement std::error::Error for Error#42
redstrate merged 1 commit intoredstrate:mainfrom
OhKannaDuh:implement_std_error_for_error

Conversation

@OhKannaDuh
Copy link
Copy Markdown
Contributor

This PR implements std::error::Error for the Error enum.

Since this already had the Display impl, adding this allows it to integrate with error handling libs such anyhow.

// This
resources.parsed::<Lvb>(&lvb_path).map_err(anyhow::Error::msg)?;
// Becomes
resources.parsed::<Lvb>(&lvb_path)?;

Just a little bit of sugar.

Copy link
Copy Markdown
Owner

@redstrate redstrate left a comment

Choose a reason for hiding this comment

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

Thanks! Simple and great fix

@redstrate redstrate merged commit d0d835a into redstrate:main Mar 16, 2026
2 checks passed
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.

2 participants