mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 10:01:25 +00:00
swarm-derive/lib: Don't clone error on inject_dial_failure (#2349)
`NetworkBehaviour::inject_dial_failure` expects a reference for the error, thus the error should not be cloned when passing it to the inner behaviours in the `NetworkBehaviour` derivation. Fixes Issue #2348.
This commit is contained in:
@ -276,10 +276,10 @@ fn build_struct(ast: &DeriveInput, data_struct: &DataStruct) -> TokenStream {
|
||||
|
||||
let inject = match field.ident {
|
||||
Some(ref i) => {
|
||||
quote! { self.#i.inject_dial_failure(peer_id, handler, error.clone()) }
|
||||
quote! { self.#i.inject_dial_failure(peer_id, handler, error) }
|
||||
}
|
||||
None => {
|
||||
quote! { self.#enum_n.inject_dial_failure(peer_id, handler, error.clone()) }
|
||||
quote! { self.#enum_n.inject_dial_failure(peer_id, handler, error) }
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user