mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-29 18:51:22 +00:00
Fix core-derive (#707)
This commit is contained in:
parent
fceaf2293b
commit
179e65ff5c
@ -107,7 +107,7 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> TokenStream {
|
|||||||
additional.push(quote!{#substream_generic: ::libp2p::tokio_io::AsyncWrite});
|
additional.push(quote!{#substream_generic: ::libp2p::tokio_io::AsyncWrite});
|
||||||
|
|
||||||
if let Some(where_clause) = where_clause {
|
if let Some(where_clause) = where_clause {
|
||||||
Some(quote!{#where_clause, #(#additional),*})
|
Some(quote!{#where_clause #(#additional),*})
|
||||||
} else {
|
} else {
|
||||||
Some(quote!{where #(#additional),*})
|
Some(quote!{where #(#additional),*})
|
||||||
}
|
}
|
||||||
|
@ -73,8 +73,7 @@ fn three_fields() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: fix this example ; a Rust bug prevent us from doing so
|
#[test]
|
||||||
/*#[test]
|
|
||||||
fn event_handler() {
|
fn event_handler() {
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
#[derive(NetworkBehaviour)]
|
#[derive(NetworkBehaviour)]
|
||||||
@ -86,7 +85,7 @@ fn event_handler() {
|
|||||||
impl<TSubstream: libp2p::tokio_io::AsyncRead + libp2p::tokio_io::AsyncWrite> Foo<TSubstream> {
|
impl<TSubstream: libp2p::tokio_io::AsyncRead + libp2p::tokio_io::AsyncWrite> Foo<TSubstream> {
|
||||||
// TODO: for some reason, the parameter cannot be `PeriodicIdentifyBehaviourEvent` or we
|
// TODO: for some reason, the parameter cannot be `PeriodicIdentifyBehaviourEvent` or we
|
||||||
// get a compilation error ; figure out why or open an issue to Rust
|
// get a compilation error ; figure out why or open an issue to Rust
|
||||||
fn foo(&mut self, ev: <libp2p::identify::PeriodicIdentifyBehaviour<TSubstream> as libp2p::core::swarm::NetworkBehaviour>::OutEvent) {
|
fn foo<TTopology>(&mut self, ev: <libp2p::identify::PeriodicIdentifyBehaviour<TSubstream> as libp2p::core::swarm::NetworkBehaviour<TTopology>>::OutEvent) {
|
||||||
let libp2p::identify::PeriodicIdentifyBehaviourEvent::Identified { .. } = ev;
|
let libp2p::identify::PeriodicIdentifyBehaviourEvent::Identified { .. } = ev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -94,7 +93,7 @@ fn event_handler() {
|
|||||||
fn foo<TSubstream: libp2p::tokio_io::AsyncRead + libp2p::tokio_io::AsyncWrite>() {
|
fn foo<TSubstream: libp2p::tokio_io::AsyncRead + libp2p::tokio_io::AsyncWrite>() {
|
||||||
require_net_behaviour::<Foo<TSubstream>>();
|
require_net_behaviour::<Foo<TSubstream>>();
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn custom_polling() {
|
fn custom_polling() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user