Diffstat (limited to 'tests/common/protocol/visitor.rs')
| -rw-r--r-- | tests/common/protocol/visitor.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/common/protocol/visitor.rs b/tests/common/protocol/visitor.rs index b79596d..f980bc5 100644 --- a/tests/common/protocol/visitor.rs +++ b/tests/common/protocol/visitor.rs @@ -2,7 +2,7 @@ use mockall::mock; use treaty::{ any::{any_trait, TypeName}, effect::{Effect, Future}, - protocol::visitor::{ValueProto, Value, VisitResult}, + protocol::visitor::{Value, ValueProto, VisitResult}, Flow, }; @@ -11,7 +11,7 @@ mock! { where for<'a, 'ctx> TypeName::T<'a, 'ctx, T>: Sized { - pub fn visit<'a, 'ctx>(&'a mut self, value: TypeName::T<'a, 'ctx, T>) -> VisitResult<()>; + pub fn visit<'a, 'ctx>(&'a mut self, value: &TypeName::T<'a, 'ctx, T>) -> VisitResult<()>; } } @@ -19,15 +19,14 @@ any_trait! { impl['ctx, T, E] MockValueVisitor<T, E> = [ ValueProto<T, E> ] where - T: TypeName::MemberType + Send, + T: TypeName::MemberType, for<'a, 'b> TypeName::T<'a, 'b, T>: Clone + Sized, E: Effect, } -impl<'ctx, T: TypeName::MemberType, E: Effect> Value<'ctx, T, E> - for MockValueVisitor<T, E> +impl<'ctx, T: TypeName::MemberType, E: Effect> Value<'ctx, T, E> for MockValueVisitor<T, E> where - for<'a, 'lt> TypeName::T<'a, 'lt, T>: Sized + Clone, + for<'a, 'lt> TypeName::T<'a, 'lt, T>: Sized, { fn visit<'a>( &'a mut self, @@ -37,7 +36,7 @@ where TypeName::T<'a, 'ctx, T>: Send, 'ctx: 'a, { - E::ready(match self.visit(value.clone()) { + E::ready(match self.visit(&value) { VisitResult::Skipped(_) => VisitResult::Skipped(value), VisitResult::Control(flow) => VisitResult::Control(flow), }) |