From d0d29e383a05328a0ee8e0b6f28d52121679e5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Kr=C3=BCger?= Date: Mon, 1 Jan 2024 12:03:05 +0100 Subject: [PATCH] chore: Don't require futures to be Sync --- car-mirror/src/common.rs | 15 +++++++++------ car-mirror/src/test_utils/local_utils.rs | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/car-mirror/src/common.rs b/car-mirror/src/common.rs index 9411fdc..73c60c5 100644 --- a/car-mirror/src/common.rs +++ b/car-mirror/src/common.rs @@ -472,17 +472,20 @@ impl Default for Config { #[cfg(test)] mod tests { + use wnfs_common::MemoryBlockStore; + use super::*; - use crate::test_utils::assert_cond_send_sync; + use crate::{test_utils::assert_cond_send_sync, traits::NoCache}; - fn send_sync_tests() { + #[allow(clippy::unreachable, unused)] + fn test_assert_send() { assert_cond_send_sync(|| { block_send( unimplemented!(), unimplemented!(), unimplemented!(), - unimplemented!(), - unimplemented!(), + unimplemented!() as &MemoryBlockStore, + &NoCache, ) }); assert_cond_send_sync(|| { @@ -490,8 +493,8 @@ mod tests { unimplemented!(), unimplemented!(), unimplemented!(), - unimplemented!(), - unimplemented!(), + unimplemented!() as &MemoryBlockStore, + &NoCache, ) }) } diff --git a/car-mirror/src/test_utils/local_utils.rs b/car-mirror/src/test_utils/local_utils.rs index 9f50371..2281d78 100644 --- a/car-mirror/src/test_utils/local_utils.rs +++ b/car-mirror/src/test_utils/local_utils.rs @@ -5,7 +5,7 @@ use anyhow::Result; use futures::TryStreamExt; use libipld::{Cid, Ipld}; use proptest::strategy::Strategy; -use wnfs_common::{utils::CondSync, BlockStore, MemoryBlockStore}; +use wnfs_common::{utils::CondSend, BlockStore, MemoryBlockStore}; #[derive(Clone, Debug)] pub(crate) struct Metrics { @@ -92,4 +92,4 @@ pub(crate) async fn total_dag_blocks(root: Cid, store: &impl BlockStore) -> Resu .len()) } -pub(crate) fn assert_cond_send_sync(fut: fn() -> T) {} +pub(crate) fn assert_cond_send_sync(_fut: fn() -> T) {}