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 }}
Repository navigation
der: extract a Decoder type in next breaking release #2533
der used to have a Decoder type, but it was refactored into SliceReader. Logic for handling nested productions winds up duplicated among the various *Reader impls in their Reader::read_nested methods, which are custom implemented per Reader type.
In ssh-encoding, which uses a similar arrangement of types, I introduced a Decoder type generic over a backend Reader which handles the central logic for consuming data from the readers, and all of the Decode methods now accept a &mut Decoder<impl Reader>: RustCrypto/SSH#618
In the next breaking release of der I think it'd be nice to do something similar. I added some partial shared logic in the Position type, but really it'd be nice to eliminate the duplication of logic between the reader types.
Activity