Add an owned string entry for CustomError.

This commit is contained in:
Tom Alexander 2023-10-17 09:27:15 -04:00
parent acc29e7977
commit 8417b5fc9d
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 2 additions and 0 deletions

View File

@ -6,6 +6,7 @@ pub(crate) type Res<T, U> = IResult<T, U, CustomError<T>>;
#[derive(Debug)] #[derive(Debug)]
pub enum CustomError<I> { pub enum CustomError<I> {
Text(String),
MyError(MyError<&'static str>), MyError(MyError<&'static str>),
Nom(I, ErrorKind), Nom(I, ErrorKind),
IO(std::io::Error), IO(std::io::Error),

View File

@ -402,6 +402,7 @@ impl<'s> From<CustomError<OrgSource<'s>>> for CustomError<&'s str> {
CustomError::Nom(input, error_kind) => CustomError::Nom(input.into(), error_kind), CustomError::Nom(input, error_kind) => CustomError::Nom(input.into(), error_kind),
CustomError::IO(err) => CustomError::IO(err), CustomError::IO(err) => CustomError::IO(err),
CustomError::BoxedError(err) => CustomError::BoxedError(err), CustomError::BoxedError(err) => CustomError::BoxedError(err),
CustomError::Text(err) => CustomError::Text(err),
} }
} }
} }