mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-01 12:11:20 +00:00
Fix generics in out_event type in derive (#922)
This commit is contained in:
parent
a22121c8e7
commit
6b3b3ed2b5
@ -2,7 +2,7 @@
|
||||
name = "libp2p-core-derive"
|
||||
edition = "2018"
|
||||
description = "Procedural macros of libp2p-core"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
|
@ -122,7 +122,7 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> TokenStream {
|
||||
match meta_item {
|
||||
syn::NestedMeta::Meta(syn::Meta::NameValue(ref m)) if m.ident == "out_event" => {
|
||||
if let syn::Lit::Str(ref s) = m.lit {
|
||||
let ident: Ident = syn::parse_str(&s.value()).unwrap();
|
||||
let ident: syn::Type = syn::parse_str(&s.value()).unwrap();
|
||||
out = quote!{#ident};
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,7 @@ fn custom_polling() {
|
||||
fn custom_event_no_polling() {
|
||||
#[allow(dead_code)]
|
||||
#[derive(NetworkBehaviour)]
|
||||
#[behaviour(out_event = "String")]
|
||||
#[behaviour(out_event = "Vec<String>")]
|
||||
struct Foo<TSubstream> {
|
||||
ping: libp2p::ping::Ping<TSubstream>,
|
||||
identify: libp2p::identify::Identify<TSubstream>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user