nom icon indicating copy to clipboard operation
nom copied to clipboard

Are nom::Err and nom::error necessary?

Open alper opened this issue 5 years ago • 1 comments

I had a hell of a time figuring out the right way to create an error. The solution finally was:

assert_eq!(
        check_eye_color("  ecl:amb"),
        Err(nom::Err::Error(nom::error::Error::new(
            "  ecl:amb",
            nom::error::ErrorKind::Tag
        )))
    );

Is it necessary to have this stuff spread out across two modules?

alper avatar Dec 05 '20 10:12 alper

The types themselves all seem necessary, as they all serve a different purpose and are composed together, but I agree that Err should definitely be in error, and probably a lot of the stuff in error should be reexported in nom

Lucretiel avatar Dec 08 '20 07:12 Lucretiel