This commit is contained in:
nora 2022-02-13 23:32:31 +01:00
parent 30f9070cca
commit 30fe45b169

View file

@ -25,6 +25,7 @@ impl<T> nom::error::ParseError<T> for TransError {
} }
} }
// todo: make this into fail_err to avoid useless allocations
pub fn err<S: Into<String>>(msg: S) -> impl FnOnce(Err<TransError>) -> Err<TransError> { pub fn err<S: Into<String>>(msg: S) -> impl FnOnce(Err<TransError>) -> Err<TransError> {
move |err| { move |err| {
let error_level = if matches!(err, nom::Err::Failure(_)) { let error_level = if matches!(err, nom::Err::Failure(_)) {