Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Make miette! macro handle related errors #390

Open
RobertasJ opened this issue Jul 30, 2024 · 3 comments
Open

Feature Request: Make miette! macro handle related errors #390

RobertasJ opened this issue Jul 30, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@RobertasJ
Copy link

Problem
Right now, to use related errors in the miette! macro, you have to create a custom struct with a #[related] field. This can be a bit cumbersome and adds extra boilerplate.

Solution
It would be great if the related field in the miette! macro could accept any iterator, like a Vec or any type implementing IntoIterator.

@zkat zkat added the enhancement New feature or request label Jul 30, 2024
@zkat
Copy link
Owner

zkat commented Jul 30, 2024

this sounds nice. I'd take a PR for this as long as it's not semver-breaking.

@RobertasJ
Copy link
Author

sure, from what i saw it was a pretty easy fix, if the macro works how i expect it to (which means i dont have to change it).

@RobertasJ
Copy link
Author

RobertasJ commented Jul 30, 2024

It seems like the reason that these havent been implemented is because this would either require the dyn objects it holds to be clone or it would have to remove its clone derive, this includes over traits like partialeq and eq. as for the related errors part, it needs lifetimes which will also probably break some stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants