Box errors to reduce return type footprint.

This commit is contained in:
Stephen Chung
2020-04-18 00:14:33 +08:00
parent 4a80997d6c
commit f5fff828e8
8 changed files with 198 additions and 160 deletions

View File

@@ -107,8 +107,8 @@ pub enum ParseErrorType {
impl ParseErrorType {
/// Make a `ParseError` using the current type and position.
pub(crate) fn into_err(self, pos: Position) -> ParseError {
ParseError(self, pos)
pub(crate) fn into_err(self, pos: Position) -> Box<ParseError> {
Box::new(ParseError(self, pos))
}
}