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

Remove using void to bypass ICE #1295

Merged
merged 1 commit into from
Nov 6, 2019
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
1 change: 0 additions & 1 deletion protocols/identify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ tokio-codec = "0.1"
tokio-io = "0.1.0"
wasm-timer = "0.1"
unsigned-varint = { version = "0.2.1", features = ["codec"] }
void = "1.0"

[dev-dependencies]
libp2p-mplex = { version = "0.12.0", path = "../../muxers/mplex" }
Expand Down
3 changes: 1 addition & 2 deletions protocols/identify/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ use smallvec::SmallVec;
use std::{io, marker::PhantomData, time::Duration};
use tokio_io::{AsyncRead, AsyncWrite};
use wasm_timer::{Delay, Instant};
use void::Void;

/// Delay between the moment we connect and the first time we identify.
const DELAY_TO_FIRST_ID: Duration = Duration::from_millis(500);
Expand Down Expand Up @@ -95,7 +94,7 @@ impl<TSubstream> ProtocolsHandler for IdentifyHandler<TSubstream>
where
TSubstream: AsyncRead + AsyncWrite,
{
type InEvent = Void;
type InEvent = ();
type OutEvent = IdentifyHandlerEvent<TSubstream>;
type Error = wasm_timer::Error;
type Substream = TSubstream;
Expand Down
3 changes: 1 addition & 2 deletions protocols/identify/src/identify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ use libp2p_swarm::{
};
use std::{collections::HashMap, collections::VecDeque, io};
use tokio_io::{AsyncRead, AsyncWrite};
use void::Void;

/// Network behaviour that automatically identifies nodes periodically, returns information
/// about them, and answers identify queries from other nodes.
Expand All @@ -53,7 +52,7 @@ pub struct Identify<TSubstream> {
/// Pending replies to send.
pending_replies: VecDeque<Reply<TSubstream>>,
/// Pending events to be emitted when polled.
events: VecDeque<NetworkBehaviourAction<Void, IdentifyEvent>>,
events: VecDeque<NetworkBehaviourAction<(), IdentifyEvent>>,
}

/// A pending reply to an inbound identification request.
Expand Down