Diffstat (limited to 'src/build/builders/core/bool.rs')
-rw-r--r--src/build/builders/core/bool.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/build/builders/core/bool.rs b/src/build/builders/core/bool.rs
index bc2706d..26ad20d 100644
--- a/src/build/builders/core/bool.rs
+++ b/src/build/builders/core/bool.rs
@@ -3,7 +3,7 @@ use core::marker::PhantomData;
use crate::{
any::OwnedStatic,
any_trait,
- effect::{Effect, Future},
+ effect::{Effect, ObjSafe},
protocol::{
visitor::{Value, ValueProto, VisitResult},
DynVisitor,
@@ -39,21 +39,23 @@ impl<E> crate::BuilderTypes for Builder<E> {
}
impl<'ctx, E: Effect> crate::Builder<'ctx, E> for Builder<E> {
- #[inline]
- fn build<'a>(self) -> Future<'a, Result<Self::Value, Self::Error>, E>
+ #[inline(always)]
+ fn build<'a>(self) -> ObjSafe<'a, Result<Self::Value, Self::Error>, E>
where
Self: 'a,
{
- E::wrap(core::future::ready(self.0.ok_or(Error::Incomplete)))
+ E::ready(self.0.ok_or(Error::Incomplete)).into()
}
- fn from_seed<'a>(_seed: Self::Seed) -> Future<'a, Self, E>
+ #[inline(always)]
+ fn from_seed<'a>(_seed: Self::Seed) -> ObjSafe<'a, Self, E>
where
Self: 'a,
{
- E::wrap(core::future::ready(Self(None, PhantomData)))
+ E::ready(Self(None, PhantomData)).into()
}
+ #[inline(always)]
fn as_visitor(&mut self) -> DynVisitor<'_, 'ctx> {
DynVisitor(self)
}
@@ -66,15 +68,15 @@ any_trait! {
}
impl<'ctx, E: Effect> Value<'ctx, OwnedStatic<bool>, E> for Builder<E> {
- #[inline]
+ #[inline(always)]
fn visit<'a>(
&'a mut self,
OwnedStatic(value): OwnedStatic<bool>,
- ) -> Future<'a, VisitResult<OwnedStatic<bool>>, E>
+ ) -> ObjSafe<'a, VisitResult<OwnedStatic<bool>>, E>
where
'ctx: 'a,
{
self.0 = Some(value);
- E::ready(Flow::Done.into())
+ E::ready(Flow::Done.into()).into()
}
}