Skip to content

Commit

Permalink
Fix rust-analyzer warnings
Browse files Browse the repository at this point in the history
Fix some warnings that rust-analyzer emits due to enabling all features.
These are annoying when you try to list all warnings in the entire
workspace.
  • Loading branch information
octol committed Oct 9, 2023
1 parent 52151c5 commit 202c676
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,14 @@ mod tests {
MixnetExecuteMsg::TestingResolveAllPendingEvents {} => {
client.testing_resolve_all_pending_events(None).ignore()
}

// We add this entry purely to try to make rust-analyzer happy
#[cfg(not(feature = "nym_mixnet_contract_common/contract-testing"))]
_ => {
unimplemented!(
"testing functionality is only available in contract-testing feature"
)
}
};
}
}
3 changes: 1 addition & 2 deletions sdk/rust/nym-sdk/examples/libp2p_ping/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use libp2p::ping::Success;
use libp2p::swarm::{keep_alive, NetworkBehaviour, SwarmEvent};
use libp2p::{identity, ping, Multiaddr, PeerId};
use log::{debug, info, LevelFilter};
use nym_sdk::mixnet::MixnetClient;
use std::error::Error;
use std::time::Duration;

Expand All @@ -70,7 +69,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
use libp2p::swarm::SwarmBuilder;
use rust_libp2p_nym::transport::NymTransport;

let client = MixnetClient::connect_new().await.unwrap();
let client = nym_sdk::mixnet::MixnetClient::connect_new().await.unwrap();

let transport = NymTransport::new(client, local_key.clone()).await?;
SwarmBuilder::with_tokio_executor(
Expand Down
1 change: 1 addition & 0 deletions sdk/rust/nym-sdk/examples/libp2p_shared/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub struct NymTransport {

impl NymTransport {
/// New transport.
#[allow(unused)]
pub async fn new(client: MixnetClient, keypair: Keypair) -> Result<Self, Error> {
Self::new_maybe_with_notify_inbound(client, keypair, None, None).await
}
Expand Down

0 comments on commit 202c676

Please sign in to comment.