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

@@ -128,9 +128,7 @@ pub(crate) fn start_of_line<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, ()>
if input.is_at_start_of_line() {
Ok((input, ()))
} else {
Err(nom::Err::Error(CustomError::MyError(MyError(
"Not at start of line",
))))
Err(nom::Err::Error(CustomError::Static("Not at start of line")))
}
}
@@ -151,9 +149,9 @@ fn _preceded_by_whitespace<'s>(
.map(|c| c.is_whitespace() || c == '\u{200B}') // 200B = Zero-width space
.unwrap_or(allow_start_of_file)
{
return Err(nom::Err::Error(CustomError::MyError(MyError(
return Err(nom::Err::Error(CustomError::Static(
"Must be preceded by a whitespace character.",
))));
)));
}
Ok((input, ()))
}
@@ -194,9 +192,7 @@ pub(crate) fn text_until_exit<'b, 'g, 'r, 's>(
#[allow(dead_code)]
fn not_yet_implemented() -> Res<OrgSource<'static>, ()> {
Err(nom::Err::Error(CustomError::MyError(MyError(
"Not implemented yet.",
))))
Err(nom::Err::Error(CustomError::Static("Not implemented yet.")))
}
#[allow(dead_code)]