Closed gdennie closed 1 year ago
map_res
requires its error value to implement nom::err::FromExternalError
which requires the result error value. However, current error type implementations by nom
namely ()
, (I, ErrorKind)
, and VerboseError
do not even hold this value.
It is meant for use with a custom error type that can hold the external error yes. If you don't use it, why not try map_opt?
Did not know about map_opt
, as such. Recall seeing the name once or twice in the docs. Will now be using it.
Thanks.
In
nom
(currently v7.1.3 with rust nightly)...The
map_res
function requires a closure that returnscore::result::Result<T,E>
. However,map_res
does actually use theErr
discriminant's value. However, requiring aResult<T,E>
result type complicates type conformance as well as the code. As such, I am curious as to whyOption<T>
was not chosen for the closure result type.