Skip to content

Commit

Permalink
fix: Add more Send + Sync bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Jan 19, 2022
1 parent 18fcd7b commit 380a5e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/backoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ impl Backoff {
/// Perform an async operation that retries with a backoff
pub async fn backy_offy<F, F1, B, C>(&mut self, request_name: &str, do_stuff: F) -> B
where
F: Fn() -> F1,
F1: std::future::Future<Output = ControlFlow<B, C>>,
C: core::fmt::Display,
F: (Fn() -> F1) + Send + Sync,
F1: std::future::Future<Output = ControlFlow<B, C>> + Send,
C: core::fmt::Display + Send,
{
loop {
let e = match do_stuff().await {
Expand Down
6 changes: 3 additions & 3 deletions src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Arc<Self::C>>;

Expand Down Expand Up @@ -282,7 +282,7 @@ mod tests {
use crate::protocol::api_key::ApiKey;
use std::sync::atomic::{AtomicBool, Ordering};

struct FakeBroker(Box<dyn Fn() -> Result<MetadataResponse, RequestError> + Sync>);
struct FakeBroker(Box<dyn Fn() -> Result<MetadataResponse, RequestError> + Send + Sync>);

impl FakeBroker {
fn success() -> Self {
Expand Down

0 comments on commit 380a5e9

Please sign in to comment.