Skip to content

Commit

Permalink
fix: Make a async-std optional
Browse files Browse the repository at this point in the history
  • Loading branch information
gurinderu committed Feb 10, 2023
1 parent fe2184a commit 6c17592
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions crates/libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ version = "0.2.0"
authors = ["Fluence Labs"]
edition = "2021"

[features]
async-std = ["dep:async-std"]

[dependencies]
libp2p = { workspace = true }
libp2p-noise = { workspace = true }
multihash = { version = "0.16.3", features = ["serde-codec"] }
futures = { workspace = true }
futures-util = "0.3.26"
async-std = { workspace = true }

async-std = { workspace = true, optional = true }
serde = { version = "1.0.152", features = ["derive"] }
serde_json = { workspace = true }
bs58 = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions crates/libp2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ mod macros;
pub mod random_multiaddr;
mod random_peer_id;
mod serde;
#[cfg(feature = "async-std")]
mod transport;
pub mod types;

pub use self::serde::*;
pub use connected_point::*;
pub use macros::*;
pub use random_peer_id::RandomPeerId;
#[cfg(feature = "async-std")]
pub use transport::{build_memory_transport, build_transport, Transport};

// libp2p reexports
Expand Down
2 changes: 1 addition & 1 deletion crates/server-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
config-utils = { workspace = true }
fs-utils = { workspace = true }
particle-protocol = { workspace = true }
fluence-libp2p = { workspace = true }
fluence-libp2p = { workspace = true, features=["async-std"] }
air-interpreter-fs = { workspace = true }
peer-metrics = { workspace = true }

Expand Down

0 comments on commit 6c17592

Please sign in to comment.