mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-14 18:41:22 +00:00
Pass &mut std::task::Context to poll
This commit is contained in:
@ -389,7 +389,7 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> TokenStream {
|
|||||||
syn::NestedMeta::Meta(syn::Meta::NameValue(ref m)) if m.path.is_ident("poll_method") => {
|
syn::NestedMeta::Meta(syn::Meta::NameValue(ref m)) if m.path.is_ident("poll_method") => {
|
||||||
if let syn::Lit::Str(ref s) = m.lit {
|
if let syn::Lit::Str(ref s) = m.lit {
|
||||||
let ident: Ident = syn::parse_str(&s.value()).unwrap();
|
let ident: Ident = syn::parse_str(&s.value()).unwrap();
|
||||||
poll_method = quote!{#name::#ident(self)};
|
poll_method = quote!{#name::#ident(self, cx)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => ()
|
_ => ()
|
||||||
|
@ -134,7 +134,7 @@ fn custom_polling() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
fn foo<TSubstream: libp2p::futures::AsyncRead + libp2p::futures::AsyncWrite + Send + Unpin + 'static>() {
|
fn foo<TSubstream: libp2p::futures::AsyncRead + libp2p::futures::AsyncWrite + Send + Unpin + 'static>(_: &mut std::task::Context) {
|
||||||
require_net_behaviour::<Foo<TSubstream>>();
|
require_net_behaviour::<Foo<TSubstream>>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -190,7 +190,7 @@ fn custom_event_and_polling() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
fn foo<TSubstream: libp2p::futures::AsyncRead + libp2p::futures::AsyncWrite + Send + Unpin + 'static>() {
|
fn foo<TSubstream: libp2p::futures::AsyncRead + libp2p::futures::AsyncWrite + Send + Unpin + 'static>(_: &mut std::task::Context) {
|
||||||
require_net_behaviour::<Foo<TSubstream>>();
|
require_net_behaviour::<Foo<TSubstream>>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user