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
{{ message }}
This repository was archived by the owner on Jul 22, 2019. It is now read-only.
This fixes#5 as proposed in that issue. Specifically, it introduces a
trait, `FromByteResponse`, and provides a generic `parse_response`
function that parses input as raw byte strings, and then maps them using
some implementation of that trait. This in turns allows users to choose
how they want to parse byte sequences in an ergonomic way.
Under the hood, this is *slightly* less efficient that it could be.
Specifically, it parses everything as `&[u8]` first, and then maps
everything using calls to `FromByteResponse`. This works fine, but will
cause unnecessary re-allocation of vectors inside a bunch of structs.
The way to work around this is to have `nom` directly use a generic
return value in all its parsers, but this unfortunately doesn't seem to
be supported at the time of writing.
0 commit comments