Diffstat (limited to 'tests/walker_struct.rs')
-rw-r--r--tests/walker_struct.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/walker_struct.rs b/tests/walker_struct.rs
index 95184a3..4ff61d1 100644
--- a/tests/walker_struct.rs
+++ b/tests/walker_struct.rs
@@ -1,7 +1,7 @@
use mockall::predicate::eq;
use treaty::{
any::{BorrowedStatic, BorrowedStaticHrt, OwnedStatic, TypeNameId},
- effect::{Blocking, Effect, Future, ReadyValue},
+ effect::{blocking::Blocking, Effect, Effective, ErasedEffective},
protocol::{
visitor::{tags, SequenceProto, TagConst, TagProto, ValueProto, VisitResult},
DynVisitor,
@@ -44,8 +44,8 @@ impl<'ctx, M> StructTypeInfo<'ctx, M> for Info {
index: usize,
value: &'ctx Self::T,
mut visitor: DynVisitor<'a, 'ctx>,
- ) -> Future<'a, Result<Flow, Self::FieldError>, E> {
- E::wrap(async move {
+ ) -> ErasedEffective<'a, Result<Flow, Self::FieldError>, E> {
+ E::from_future(async move {
match index {
// A real impl would be expected to tag these values with the field name.
0 => {
@@ -55,7 +55,10 @@ impl<'ctx, M> StructTypeInfo<'ctx, M> for Info {
.unwrap();
// Emit the field value.
- assert_eq!(obj.visit(OwnedStatic(value.a)).await, Flow::Done.into());
+ assert_eq!(
+ obj.visit(OwnedStatic(value.a)).into_future().await,
+ Flow::Done.into()
+ );
// There are more fields.
Ok(Flow::Continue)
@@ -67,7 +70,10 @@ impl<'ctx, M> StructTypeInfo<'ctx, M> for Info {
.unwrap();
// Emit the field value.
- assert_eq!(obj.visit(OwnedStatic(value.b)).await, Flow::Done.into());
+ assert_eq!(
+ obj.visit(OwnedStatic(value.b)).into_future().await,
+ Flow::Done.into()
+ );
// There are no more fields.
Ok(Flow::Done)
@@ -75,6 +81,7 @@ impl<'ctx, M> StructTypeInfo<'ctx, M> for Info {
_ => Ok(Flow::Done),
}
})
+ .into_erased()
}
}