Remove owned String from CustomError.
This is a 15% performance improvement.
This commit is contained in:
@@ -6,8 +6,6 @@ pub(crate) type Res<T, U> = IResult<T, U, CustomError>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum CustomError {
|
||||
#[allow(dead_code)]
|
||||
Text(String),
|
||||
Static(&'static str),
|
||||
IO(std::io::Error),
|
||||
Parser(ErrorKind),
|
||||
@@ -35,9 +33,3 @@ impl From<&'static str> for CustomError {
|
||||
CustomError::Static(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for CustomError {
|
||||
fn from(value: String) -> Self {
|
||||
CustomError::Text(value)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user