From 380a5e9d88ba092d0b0174ee9d80581f43319811 Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Fri, 14 Jan 2022 17:18:26 -0500 Subject: [PATCH] fix: Add more Send + Sync bounds --- src/backoff.rs | 6 +++--- src/connection.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backoff.rs b/src/backoff.rs index 09412b05..afec84f2 100644 --- a/src/backoff.rs +++ b/src/backoff.rs @@ -85,9 +85,9 @@ impl Backoff { /// Perform an async operation that retries with a backoff pub async fn backy_offy(&mut self, request_name: &str, do_stuff: F) -> B where - F: Fn() -> F1, - F1: std::future::Future>, - C: core::fmt::Display, + F: (Fn() -> F1) + Send + Sync, + F1: std::future::Future> + Send, + C: core::fmt::Display + Send, { loop { let e = match do_stuff().await { diff --git a/src/connection.rs b/src/connection.rs index 60470905..55c689f4 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -181,8 +181,8 @@ impl Connect for MessengerTransport { } #[async_trait] -trait ArbitraryBrokerCache { - type C: Connect; +trait ArbitraryBrokerCache: Send + Sync { + type C: Connect + Send + Sync; async fn get(&self) -> Result>; @@ -282,7 +282,7 @@ mod tests { use crate::protocol::api_key::ApiKey; use std::sync::atomic::{AtomicBool, Ordering}; - struct FakeBroker(Box Result + Sync>); + struct FakeBroker(Box Result + Send + Sync>); impl FakeBroker { fn success() -> Self {