Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Removed unneeded Send/Sync constrains #37

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Implementation of bitswap protocol for libp2p"
[dependencies]
async-trait = "0.1"
asynchronous-codec = "0.7"
blockstore = "0.1"
blockstore = "0.3"
bytes = "1"
cid = "0.11"
fnv = "1.0.5"
Expand Down
4 changes: 2 additions & 2 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{Behaviour, Error, Result};
/// # }
pub struct BehaviourBuilder<const S: usize, B>
where
B: Blockstore + Send + Sync + 'static,
B: Blockstore + 'static,
{
protocol_prefix: Option<String>,
blockstore: B,
Expand All @@ -30,7 +30,7 @@ where

impl<const S: usize, B> BehaviourBuilder<S, B>
where
B: Blockstore + Send + Sync + 'static,
B: Blockstore + 'static,
{
/// Creates a new builder for [`Behaviour`].
pub(crate) fn new(blockstore: B) -> Self {
Expand Down
4 changes: 2 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ enum TaskResult<const S: usize> {
#[derive(Debug)]
pub(crate) struct ClientBehaviour<const S: usize, B>
where
B: Blockstore + Send + Sync,
B: Blockstore,
{
store: Arc<B>,
protocol: StreamProtocol,
Expand Down Expand Up @@ -97,7 +97,7 @@ pub enum SendingState {

impl<const S: usize, B> ClientBehaviour<S, B>
where
B: Blockstore + Send + Sync + 'static,
B: Blockstore + 'static,
{
pub(crate) fn new(config: ClientConfig, store: Arc<B>, protocol_prefix: Option<&str>) -> Self {
let protocol = stream_protocol(protocol_prefix, "/ipfs/bitswap/1.2.0")
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub use crate::client::QueryId;
#[derive(Debug)]
pub struct Behaviour<const MAX_MULTIHASH_SIZE: usize, B>
where
B: Blockstore + Send + Sync + 'static,
B: Blockstore + 'static,
{
protocol: StreamProtocol,
client: ClientBehaviour<MAX_MULTIHASH_SIZE, B>,
Expand Down Expand Up @@ -95,7 +95,7 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;

impl<const MAX_MULTIHASH_SIZE: usize, B> Behaviour<MAX_MULTIHASH_SIZE, B>
where
B: Blockstore + Send + Sync + 'static,
B: Blockstore + 'static,
{
/// Creates a new [`Behaviour`] with the default configuration.
pub fn new(blockstore: B) -> Behaviour<MAX_MULTIHASH_SIZE, B> {
Expand All @@ -122,7 +122,7 @@ where

impl<const MAX_MULTIHASH_SIZE: usize, B> NetworkBehaviour for Behaviour<MAX_MULTIHASH_SIZE, B>
where
B: Blockstore + Send + Sync + 'static,
B: Blockstore + 'static,
{
type ConnectionHandler = ConnHandler<MAX_MULTIHASH_SIZE>;
type ToSwarm = Event;
Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl<const S: usize> PeerWantlist<S> {

impl<const S: usize, B> ServerBehaviour<S, B>
where
B: Blockstore + Send + Sync + 'static,
B: Blockstore + 'static,
{
pub(crate) fn new(store: Arc<B>, protocol_prefix: Option<&str>) -> Self {
let protocol = stream_protocol(protocol_prefix, "/ipfs/bitswap/1.2.0")
Expand Down
Loading