From 23e2a37785433660ae45f18a3ee0339fe0ba52f8 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Wed, 24 Feb 2021 23:23:23 -0500 Subject: [PATCH] add error trait impl for ParserError --- src/parser.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index 50bde3c..edfedd1 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -19,9 +19,9 @@ use nom::error::{Error as NomError, ErrorKind}; use nom::multi::{many0, many1}; use nom::sequence::delimited; use nom::IResult; -use std::borrow::Cow; use std::fmt::Display; use std::iter::FusedIterator; +use std::{borrow::Cow, error::Error}; /// Syntactic events that occurs in the config. Despite all these variants /// holding a [`Cow`] instead over a simple reference, the parser will only emit @@ -205,6 +205,8 @@ impl Display for ParserError<'_> { } } +impl Error for ParserError<'_> {} + /// A zero-copy `git-config` file parser. /// /// This is parser exposes low-level syntactic events from a `git-config` file.