Diffstat (limited to 'src/build/builders/core/bool.rs')
| -rw-r--r-- | src/build/builders/core/bool.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/build/builders/core/bool.rs b/src/build/builders/core/bool.rs index c9c0be9..3becdae 100644 --- a/src/build/builders/core/bool.rs +++ b/src/build/builders/core/bool.rs @@ -3,7 +3,8 @@ use core::{marker::PhantomData, ops::ControlFlow}; use crate::{ any::static_wrapper::OwnedStatic, any_trait, - protocol::{visitor::Value, AsObj, AsyncEffect, Yield, Effect, SyncEffect}, + effect::{AsObj, AsyncEffect, Effect, SyncEffect, Yield}, + protocol::visitor::Value, AsVisitor, }; @@ -30,7 +31,10 @@ where type Value = bool; #[inline] - fn build<'a>(self) -> Result<Self::Value, Self::Error> where Self: 'a { + fn build<'a>(self) -> Result<Self::Value, Self::Error> + where + Self: 'a, + { self.0.ok_or(Error::Incomplete) } @@ -57,16 +61,16 @@ impl<'ctx> AsVisitor<'ctx, AsyncEffect> for Builder<AsyncEffect> { any_trait! { impl['a, 'ctx, E] Builder<E> = [ - dyn Value<'ctx, OwnedStatic<bool>, SyncEffect> + 'a, + dyn Value<'a, 'ctx, OwnedStatic<bool>, SyncEffect> + 'a, ] } -impl<'ctx, E> Value<'ctx, OwnedStatic<bool>, SyncEffect> for Builder<E> { +impl<'a, 'ctx: 'a, E> Value<'a, 'ctx, OwnedStatic<bool>, SyncEffect> for Builder<E> { #[inline] - fn visit<'a>(&'a mut self, OwnedStatic(value): OwnedStatic<bool>) -> Yield<'a, 'ctx, ControlFlow<(), ()>, SyncEffect> - where - 'ctx: 'a, - { + fn visit( + &'a mut self, + OwnedStatic(value): OwnedStatic<bool>, + ) -> Yield<'a, 'ctx, ControlFlow<(), ()>, SyncEffect> { self.0 = Some(value); ControlFlow::Continue(()) } |