Continue removing MyError.

This commit is contained in:
Tom Alexander
2023-10-17 10:09:37 -04:00
parent c9d7251e3b
commit 77e6c22ad8
29 changed files with 84 additions and 128 deletions

View File

@@ -233,9 +233,9 @@ fn _text_markup_object<'b, 'g, 'r, 's, 'c>(
#[cfg(feature = "tracing")]
let _enter = span.enter();
if exit_matcher_parser(context, remaining).is_ok() {
return Err(nom::Err::Error(CustomError::MyError(MyError(
return Err(nom::Err::Error(CustomError::Static(
"Parent exit matcher is triggering.",
))));
)));
}
}
@@ -289,9 +289,9 @@ fn _text_markup_string<'b, 'g, 'r, 's, 'c>(
#[cfg(feature = "tracing")]
let _enter = span.enter();
if exit_matcher_parser(context, remaining).is_ok() {
return Err(nom::Err::Error(CustomError::MyError(MyError(
return Err(nom::Err::Error(CustomError::Static(
"Parent exit matcher is triggering.",
))));
)));
}
}
@@ -320,9 +320,9 @@ fn pre<'b, 'g, 'r, 's>(
// If None, we are at the start of the file which is technically the beginning of a line.
Some('-') | Some('(') | Some('{') | Some('\'') | Some('"') => {}
Some(_) => {
return Err(nom::Err::Error(CustomError::MyError(MyError(
return Err(nom::Err::Error(CustomError::Static(
"Not a valid pre character for text markup.",
))));
)));
}
None => unreachable!(), // None is for start of file, which should already be handled by the start_of_line matcher above.
};
@@ -359,9 +359,9 @@ fn _text_markup_end<'b, 'g, 'r, 's, 'c>(
contents_start_offset: usize,
) -> Res<OrgSource<'s>, OrgSource<'s>> {
if input.get_byte_offset() == contents_start_offset {
return Err(nom::Err::Error(CustomError::MyError(MyError(
return Err(nom::Err::Error(CustomError::Static(
"Text markup cannot be empty",
))));
)));
}
not(preceded_by_whitespace(false))(input)?;
let (remaining, _marker) = terminated(
@@ -494,9 +494,9 @@ fn _rematch_text_markup_object<'b, 'g, 'r, 's, 'x>(
#[cfg(feature = "tracing")]
let _enter = span.enter();
if exit_matcher_parser(context, remaining).is_ok() {
return Err(nom::Err::Error(CustomError::MyError(MyError(
return Err(nom::Err::Error(CustomError::Static(
"Parent exit matcher is triggering.",
))));
)));
}
}