You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If errors need to be reported during processing, e.g. in the callbacks passed to Structure::each_variant and VariantInfo::construct, one's only real option is to embed compile_error!() macro invocations into the returned TokenStream. However this makes testing a little complex. Would it be possible to provide fallible versions of such methods instead:
(obviously there would be quite a few such methods across the library).
I think the closest users can currently get is by manually iterating the variants/bindings, collecting into a Result<Vec<_>, _> and then (on the happy path) calling the relevant infallible method that takes from such collected vector—which needlessly allocates and is just a tad tedious.
If this would be acceptable, I'd be happy to submit a PR.
The text was updated successfully, but these errors were encountered:
If errors need to be reported during processing, e.g. in the callbacks passed to
Structure::each_variant
andVariantInfo::construct
, one's only real option is to embedcompile_error!()
macro invocations into the returnedTokenStream
. However this makes testing a little complex. Would it be possible to provide fallible versions of such methods instead:and
(obviously there would be quite a few such methods across the library).
I think the closest users can currently get is by manually iterating the variants/bindings, collecting into a
Result<Vec<_>, _>
and then (on the happy path) calling the relevant infallible method that takes from such collected vector—which needlessly allocates and is just a tad tedious.If this would be acceptable, I'd be happy to submit a PR.
The text was updated successfully, but these errors were encountered: