Diffstat (limited to 'src/transform.rs')
| -rw-r--r-- | src/transform.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/transform.rs b/src/transform.rs index 4d9e99d..b9cc346 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -5,7 +5,7 @@ use crate::{ effect::{ blocking::Blocking, r#async::Async, Effect, Effective, EffectiveExt, ErasedEffective, }, - Build, BuilderTypes, DefaultMode, Walk, Walker, WalkerTypes, + Build, BuilderTypes, DefaultMode, Walk, Walker, }; #[inline(always)] @@ -37,19 +37,15 @@ pub fn transform<'a, 'ctx: 'a, B: Builder<'ctx, E> + 'a, W: Walker<'ctx, E> + 'a // }) } -pub enum BuildError<B, W> -where - B: BuilderTypes, - W: WalkerTypes, -{ - Builder(B::Error), - Both(B::Error, W::Error), +pub enum BuildError<B, W> { + Builder(B), + Both(B, W), } -impl<B, W> core::fmt::Debug for BuildError<B, W> +impl<B, W> core::fmt::Debug for BuildError<B, W> where - B: BuilderTypes, - W: WalkerTypes, + B: core::fmt::Debug, + W: core::fmt::Debug, { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { @@ -61,7 +57,7 @@ where pub trait BuildExt { /// Build a value of this type using the default builder. - fn build<'ctx, W>(walker: W) -> Result<Self, BuildError<Self::Builder, W>> + fn build<'ctx, W>(walker: W) -> Result<Self, BuildError<<Self::Builder as BuilderTypes>::Error, <W as Walker<'ctx, Blocking>>::Error>> where Self: Build<'ctx, DefaultMode, Blocking>, <Self::Builder as BuilderTypes>::Seed: Default, @@ -76,7 +72,7 @@ pub trait BuildExt { fn build_async<'ctx, W>( walker: W, - ) -> impl Future<Output = Result<Self, BuildError<Self::Builder, W>>> + Send + Sync + ) -> impl Future<Output = Result<Self, BuildError<<Self::Builder as BuilderTypes>::Error, <W as Walker<'ctx, Async>>::Error>>> + Send + Sync where Self: Build<'ctx, DefaultMode, Async>, <Self::Builder as BuilderTypes>::Seed: Default, |