swarm-derive: Specify NetworkBehaviour by full path (#2932)

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
folex 2022-09-27 13:27:32 +04:00 committed by GitHub
parent b28ab2c6bc
commit 04b07c4d14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -2,8 +2,10 @@
- Fix an issue where the derive would generate bad code if the type parameters between the behaviour and a custom
out event differed. See [PR 2907].
- Fix an issue where the derive would generate incorrect code depending on available imports. See [PR 2921].
[PR 2907]: https://github.com/libp2p/rust-libp2p/pull/2907
[PR 2921]: https://github.com/libp2p/rust-libp2p/pull/2921
# 0.30.0

View File

@ -125,7 +125,7 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> TokenStream {
)
.unwrap();
let ty = &field.ty;
quote! {#variant(<#ty as NetworkBehaviour>::OutEvent)}
quote! {#variant(<#ty as #trait_to_impl>::OutEvent)}
})
.collect::<Vec<_>>();
let visibility = &ast.vis;