Open changhe3 opened 4 years ago
Is there any suggested path to adding this?
I think making nom::ExtendInto::Extender
into a generic type parameter and implement ExtendInto<Cow<'_, str>>
and ExtendInto<Cow<'_, [u8]>>
for various types would be enough. This would be breaking change though. Maybe add another trait ExtendIntoV2
that does the same and add a escape_transform_v2
using the new trait.
I attempted but encountered some lifetime issues. I believe a complete redesign of ExtendInto
may be warranted.
In many cases, the parsed text segment contains no escaped symbols, returning a reference would be sufficient. Current
ExtendInto
API also doesn't support custom implementations.