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
I wish I could match a string and parse the captured groups in a single call. I imagine the new method return a Result<tuple, SomeError>, where each type inside that tuple is having FromStr implemented.
I know one of the problem here is the choice of SomeError, since different FromStr have different Err type. Maybe Box<dyn Error + 'lifetime_of_the_str> is a viable solution.
The text was updated successfully, but these errors were encountered:
It's not really clear to me how this machinery is supposed to work. What enables FromStr to work on tuples, for example? The error situation also looks pretty unfortunate. And what happens when there isn't a match? On top of that, I don't think this actually saves much work, and thus isn't buying that much convenience. I'd encourage you to write out the alternative and compare them.
Finally, this would also have the same issues as #824. Your API doesn't account for captures that don't participate in a match.
I wish I could match a string and parse the captured groups in a single call. I imagine the new method return a
Result<tuple, SomeError>
, where each type inside that tuple is havingFromStr
implemented.I know one of the problem here is the choice of
SomeError
, since differentFromStr
have differentErr
type. MaybeBox<dyn Error + 'lifetime_of_the_str>
is a viable solution.The text was updated successfully, but these errors were encountered: