From 588e73ae83b9c67944ca4f9686339c605c5f102d Mon Sep 17 00:00:00 2001 From: Ho Kim Date: Wed, 22 Nov 2023 08:34:59 +0000 Subject: [PATCH] feat: add Send trait for GenVisitor --- schemars/src/gen.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schemars/src/gen.rs b/schemars/src/gen.rs index a31839a0..ca8fe1e2 100644 --- a/schemars/src/gen.rs +++ b/schemars/src/gen.rs @@ -122,7 +122,7 @@ impl SchemaSettings { } /// Appends the given visitor to the list of [visitors](SchemaSettings::visitors) for these `SchemaSettings`. - pub fn with_visitor(mut self, visitor: impl Visitor + Debug + Clone + 'static) -> Self { + pub fn with_visitor(mut self, visitor: impl GenVisitor + 'static) -> Self { self.visitors.push(Box::new(visitor)); self } @@ -497,7 +497,7 @@ impl SchemaGenerator { /// let v: &dyn GenVisitor = &MyVisitor; /// assert!(v.as_any().is::()); /// ``` -pub trait GenVisitor: Visitor + Debug + DynClone + Any { +pub trait GenVisitor: Visitor + Debug + DynClone + Send + Any { /// Upcasts this visitor into an `Any`, which can be used to inspect and manipulate it as its concrete type. fn as_any(&self) -> &dyn Any; } @@ -506,7 +506,7 @@ dyn_clone::clone_trait_object!(GenVisitor); impl GenVisitor for T where - T: Visitor + Debug + Clone + Any, + T: Visitor + Debug + Clone + Send + Any, { fn as_any(&self) -> &dyn Any { self