From 0c93afd2e6a78f7a0cf4122a094e6c3f301b96b4 Mon Sep 17 00:00:00 2001 From: Jonas Fager Date: Thu, 21 Dec 2023 11:48:45 +0100 Subject: [PATCH] Need to make filter sendable across awaits --- src/filter.rs | 2 +- src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/filter.rs b/src/filter.rs index d49136c..f76f175 100644 --- a/src/filter.rs +++ b/src/filter.rs @@ -4,7 +4,7 @@ /// /// The `Filter` trait is implemented by all the filters. -pub trait Filter { +pub trait Filter: Send { fn filter(&self) -> String; } diff --git a/src/lib.rs b/src/lib.rs index ac8979c..638ef8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -169,7 +169,7 @@ impl LdapClient { &mut self, base: &str, scope: Scope, - filter: &dyn Filter, + filter: &(impl Filter+?Sized), attributes: &Vec<&str>, ) -> Result { let search = self @@ -310,7 +310,7 @@ impl LdapClient { &mut self, base: &str, scope: Scope, - filter: &dyn Filter, + filter: &impl Filter, attributes: &Vec<&str>, ) -> Result { let search_entry = self.search_innter(base, scope, filter, attributes).await?;