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 was working on a project to generate nom parse functions using macros. But I'm running into the problem that automatically supporting floating numbers is hard, because of how the ParseTo trait is implemented. For example, the float function currently expects that ParseTo<f32> should be implemented. But to support this in my generic trait, every potential importer would need to add that constraint.
I think that the type R on ParseTo should not be on the trait itself, but on the function. Then the trait becomes easier to use. An improved version would look something like:
that looks useful yes, but that's not someting I would merge for the moment, as that will make a breaking change in the public API. Noting this for nom 9
Hi!
I was working on a project to generate nom parse functions using macros. But I'm running into the problem that automatically supporting floating numbers is hard, because of how the
ParseTo
trait is implemented. For example, thefloat
function currently expects thatParseTo<f32>
should be implemented. But to support this in my generic trait, every potential importer would need to add that constraint.I think that the type
R
onParseTo
should not be on the trait itself, but on the function. Then the trait becomes easier to use. An improved version would look something like:I'll work on a PR to open soon, so we can check the impact.
The text was updated successfully, but these errors were encountered: