From 0968b049fec620f12421207c9f09834d03edcdd0 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Wed, 16 Dec 2020 16:38:45 +0100 Subject: [PATCH] protocols/request-response: Derive Clone for {Inbound,Outbound}Failure (#1891) --- protocols/request-response/CHANGELOG.md | 3 +++ protocols/request-response/src/lib.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md index 7685ecab2b0..d81fe737c5b 100644 --- a/protocols/request-response/CHANGELOG.md +++ b/protocols/request-response/CHANGELOG.md @@ -6,6 +6,9 @@ to the underlying connection closing. [PR 1886](https://github.com/libp2p/rust-libp2p/pull/1886). +- Derive Clone for `InboundFailure` and `Outbound}Failure`. + [PR 1891](https://github.com/libp2p/rust-libp2p/pull/1891) + # 0.7.0 [2020-12-08] - Refine emitted events for inbound requests, introducing diff --git a/protocols/request-response/src/lib.rs b/protocols/request-response/src/lib.rs index 0a1062102b1..a9806c3c22d 100644 --- a/protocols/request-response/src/lib.rs +++ b/protocols/request-response/src/lib.rs @@ -163,7 +163,7 @@ pub enum RequestResponseEvent /// Possible failures occurring in the context of sending /// an outbound request and receiving the response. -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum OutboundFailure { /// The request could not be sent because a dialing attempt failed. DialFailure, @@ -183,7 +183,7 @@ pub enum OutboundFailure { /// Possible failures occurring in the context of receiving an /// inbound request and sending a response. -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum InboundFailure { /// The inbound request timed out, either while reading the /// incoming request or before a response is sent, e.g. if