Skip to content

Commit

Permalink
chore: Removed unneeded Send/Sync constrains
Browse files Browse the repository at this point in the history
  • Loading branch information
oblique committed Mar 31, 2024
1 parent c8ddd4e commit 9bd29f0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
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

0 comments on commit 9bd29f0

Please sign in to comment.