Diffstat (limited to 'src/build/builders/core/struct.rs')
| -rw-r--r-- | src/build/builders/core/struct.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/build/builders/core/struct.rs b/src/build/builders/core/struct.rs index 890ffda..6bc1ef1 100644 --- a/src/build/builders/core/struct.rs +++ b/src/build/builders/core/struct.rs @@ -243,19 +243,22 @@ where E: Effect, { #[inline(always)] - fn request_hint<'a>( - &'a mut self, - walker: DynWalker<'a, 'ctx>, - ) -> ErasedEffective<'a, VisitResult<DynWalker<'a, 'ctx>>, E> { + fn request_hint<'this: 'e, 'walker: 'e, 'e>( + &'this mut self, + walker: DynWalker<'walker, 'ctx>, + ) -> ErasedEffective<'e, VisitResult, E> + where + 'ctx: 'this + 'walker, + { E::as_ctx((self, walker), |(this, walker)| { // Start with a hint to use the value protocol to directly transfer the // struct value. - hint_protocol::<ValueProto<Info::ValueT, E>>(walker.cast(), *this, ()).cast() + hint_protocol::<ValueProto<Info::ValueT, E>, _>(walker.cast(), *this, ()).cast() }) .if_not_finished(|(this, walker)| { // Next hint that the struct protocol should be used to switch into // map-like if the walker supports it. - hint_protocol::<TagProto<tags::Struct, E>>( + hint_protocol::<TagProto<tags::Struct, E>, _>( walker.cast(), *this, TagHint { kind: TagConst }, @@ -266,7 +269,7 @@ where // If the struct hint didn't work, // then hint that the map protocol should be used to switch into // map-like if the walker supports it. - hint_protocol::<TagProto<tags::Map, E>>( + hint_protocol::<TagProto<tags::Map, E>, _>( walker.cast(), *this, TagHint { kind: TagConst }, @@ -276,7 +279,7 @@ where .if_not_finished(|(this, walker)| { // Lastly hint to use a sequence to get the field values. // We hint with the exact number of fields we are expecting. - hint_protocol::<SequenceProto<E>>( + hint_protocol::<SequenceProto<E>, _>( walker.cast(), *this, SequenceHint { @@ -285,10 +288,7 @@ where ) .cast() }) - .map(|((_, walker), result)| match result { - VisitResult::Skipped(()) => VisitResult::Skipped(walker), - VisitResult::Control(flow) => VisitResult::Control(flow), - }) + .remove_ctx() } } @@ -328,7 +328,7 @@ where &'this mut self, _kind: tags::Struct, walker: DynWalkerObjSafe<'walker, 'ctx, E>, - ) -> ErasedEffective<'e, VisitResult<DynWalkerObjSafe<'walker, 'ctx, E>>, E> { + ) -> ErasedEffective<'e, VisitResult, E> { // If this protocol is used then we need to create the builders. E::as_ctx(self, |this| this.make_builders().cast()).then(|(this, _)| { if let Inner::Builders { kind, .. } = &mut this.inner { @@ -354,7 +354,7 @@ where &'this mut self, _kind: tags::Map, walker: DynWalkerObjSafe<'walker, 'ctx, E>, - ) -> ErasedEffective<'e, VisitResult<DynWalkerObjSafe<'walker, 'ctx, E>>, E> { + ) -> ErasedEffective<'e, VisitResult, E> { // If this protocol is used then we need to create the builders. E::as_ctx(self, |this| this.make_builders().cast()).then(|(this, _)| { if let Inner::Builders { kind, .. } = &mut this.inner { @@ -382,7 +382,7 @@ where fn visit<'a: 'c, 'b: 'c, 'c>( &'a mut self, scope: DynSequenceScope<'b, 'ctx, E>, - ) -> ErasedEffective<'c, VisitResult<DynSequenceScope<'b, 'ctx, E>>, E> + ) -> ErasedEffective<'c, VisitResult, E> where 'ctx: 'a + 'b + 'c, { @@ -481,7 +481,7 @@ where &'a mut self, _key: tags::Key, walker: DynWalkerObjSafe<'b, 'ctx, E>, - ) -> ErasedEffective<'c, VisitResult<DynWalkerObjSafe<'b, 'ctx, E>>, E> { + ) -> ErasedEffective<'c, VisitResult, E> { let visitor = NameVisitor::<I, M, E> { field_marker: None, _marker: Default::default(), |