Skip to content

Commit

Permalink
refactor: Remove redundant async signature (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 authored Jun 24, 2024
1 parent d7b2c01 commit e167d63
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- feat: Add AddPeerOpt::{set_keepalive, keepalive, can_keep_alive). [PR 240](https://github.com/dariusc93/rust-ipfs/pull/240)
- feat: Add IntoStreamProtocol, replacing StreamProtocolRef. [PR 244](https://github.com/dariusc93/rust-ipfs/pull/244)
- feat: Add `UninitializedIpfs::set_connection_limits` and change behaviour order. [PR 246](https://github.com/dariusc93/rust-ipfs/pull/246)
- refactor: Remove redundant async signature. [PR 247](https://github.com/dariusc93/rust-ipfs/pull/247)

# 0.11.20
- feat: Add Ipfs::{add,remove}_external_address.
Expand Down
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,9 +973,7 @@ impl<C: NetworkBehaviour<ToSwarm = void::Void> + Send> UninitializedIpfs<C> {
&ipfs.repo,
exec_span,
(custom_behaviour, custom_transport),
)
.instrument(tracing::trace_span!(parent: &init_span, "swarm"))
.await?;
)?;

let IpfsOptions {
listening_addrs, ..
Expand Down
2 changes: 1 addition & 1 deletion src/p2p/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ where
C: NetworkBehaviour,
<C as NetworkBehaviour>::ToSwarm: Debug + Send,
{
pub async fn new(
pub fn new(
keypair: &Keypair,
options: &IpfsOptions,
repo: &Repo,
Expand Down
5 changes: 2 additions & 3 deletions src/p2p/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl Default for SwarmConfig {
#[allow(deprecated)]
//TODO: use libp2p::SwarmBuilder
/// Creates a new IPFS swarm.
pub async fn create_swarm<C>(
pub fn create_swarm<C>(
keypair: &Keypair,
options: &IpfsOptions,
repo: &Repo,
Expand All @@ -197,8 +197,7 @@ where

let idle = options.connection_idle;

let (behaviour, relay_transport) =
behaviour::Behaviour::new(&keypair, options, repo, custom).await?;
let (behaviour, relay_transport) = behaviour::Behaviour::new(&keypair, options, repo, custom)?;

// Set up an encrypted TCP transport over the Yamux. If relay transport is supplied, that will be apart
let transport = match custom_transport {
Expand Down

0 comments on commit e167d63

Please sign in to comment.