1+ use crate :: ThenWithContextParser ;
12use crate :: and:: { AndParser , Combiner , KeepLeftCombiner , KeepRightCombiner , TupleCombiner } ;
23use crate :: and_then:: AndThenParser ;
34use crate :: and_then_err:: AndThenErrParser ;
@@ -12,10 +13,10 @@ use crate::map_ctx::MapCtxParser;
1213use crate :: map_err:: {
1314 ErrorMapper , FatalErrorOverrider , MapErrParser , SoftErrorOverrider , ToFatalErrorMapper
1415} ;
16+ use crate :: no_context:: NoContextParser ;
1517use crate :: or_default:: OrDefaultParser ;
1618use crate :: peek:: PeekParser ;
1719use crate :: to_option:: ToOptionParser ;
18- use crate :: { NoContextParser , ThenWithContextParser } ;
1920
2021/// A parser uses the given input in order to produce a result.
2122pub trait Parser < I , C = ( ) >
@@ -348,7 +349,11 @@ where
348349 // NoContext
349350 // =======================================================================
350351
351- fn no_context < C2 > ( self ) -> NoContextParser < Self , C , C2 >
352+ /// Stops propagating the context to the underlying parser.
353+ /// The underlying parser might also have a different context type,
354+ /// so this can be used to resolve context type mismatches,
355+ /// as long as the underlying parser does not use the parent context.
356+ fn no_context < COut > ( self ) -> NoContextParser < Self , COut , C >
352357 where
353358 Self : Sized ,
354359 {
0 commit comments