From 3bbcfadec7ebd774193d0944e642d935d065cfa0 Mon Sep 17 00:00:00 2001 From: timofey Date: Sat, 29 Jul 2023 18:43:15 +0000 Subject: [PATCH] `Mode::ExtensionResult` --- src/rcore/modes.rs | 4 ++++ src/rstd/inlining/modes.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/rcore/modes.rs b/src/rcore/modes.rs index 0286d49..036b836 100644 --- a/src/rcore/modes.rs +++ b/src/rcore/modes.rs @@ -5,6 +5,8 @@ use super::*; pub trait Mode { type ParseResult; + type ExtensionResult; + fn map_err( result: Self::ParseResult, f: impl FnOnce(E0) -> E1, @@ -68,6 +70,8 @@ pub struct RegularMode; impl Mode for RegularMode { type ParseResult = Result; + type ExtensionResult = Result; + fn map_err( result: Self::ParseResult, f: impl FnOnce(E0) -> E1, diff --git a/src/rstd/inlining/modes.rs b/src/rstd/inlining/modes.rs index 10f3d95..c6dbbcb 100644 --- a/src/rstd/inlining/modes.rs +++ b/src/rstd/inlining/modes.rs @@ -5,6 +5,8 @@ pub struct InliningMode; impl Mode for InliningMode { type ParseResult = Result<(A, I), E>; + type ExtensionResult = E; + fn map_err( result: Self::ParseResult, f: impl FnOnce(E0) -> E1,