Skip to content

Commit

Permalink
swarm-derive: Specify NetworkBehaviour by full path (#2932)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Max Inden <mail@max-inden.de>
  • Loading branch information
3 people committed Sep 27, 2022
1 parent b28ab2c commit 04b07c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions swarm-derive/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion swarm-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 04b07c4

Please sign in to comment.