From 5b316fb31b4c97f6d889506447e108ed7996e2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20Tam=C3=A1s?= Date: Sat, 6 Jun 2020 00:45:17 +0200 Subject: [PATCH] Removed Any bound from Visitor (#41) --- schemars/src/gen.rs | 2 +- schemars/src/visit.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/schemars/src/gen.rs b/schemars/src/gen.rs index 9579347..b3f02a9 100644 --- a/schemars/src/gen.rs +++ b/schemars/src/gen.rs @@ -101,7 +101,7 @@ impl SchemaSettings { } /// TODO document - pub fn with_visitor(mut self, visitor: impl Visitor) -> Self { + pub fn with_visitor(mut self, visitor: impl Visitor + 'static) -> Self { self.visitors.0.push(Arc::new(visitor)); self } diff --git a/schemars/src/visit.rs b/schemars/src/visit.rs index 7308d42..2f7b454 100644 --- a/schemars/src/visit.rs +++ b/schemars/src/visit.rs @@ -1,7 +1,7 @@ use crate::schema::{RootSchema, Schema, SchemaObject, SingleOrVec}; -use std::{any::Any, fmt::Debug}; +use std::fmt::Debug; -pub trait Visitor: Debug + Any { +pub trait Visitor: Debug { fn visit_root_schema(&self, root: &mut RootSchema) { visit_root_schema(self, root) }