From 4c8dccd569b6c411c9f41edfb70eee596d69ffac Mon Sep 17 00:00:00 2001
From: Darius <darius.clark@proton.me>
Date: Wed, 29 Nov 2023 00:30:21 -0500
Subject: [PATCH] chore: Derive `PartialOrd` and `Ord` for
 {Outbound,Inbound}RequestId

---
 Cargo.lock                              | 2 +-
 Cargo.toml                              | 2 +-
 protocols/request-response/CHANGELOG.md | 4 ++++
 protocols/request-response/Cargo.toml   | 2 +-
 protocols/request-response/src/lib.rs   | 4 ++--
 5 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock
index 617d54e9b2b..1d7b271aacf 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3057,7 +3057,7 @@ dependencies = [
 
 [[package]]
 name = "libp2p-request-response"
-version = "0.26.0"
+version = "0.26.1"
 dependencies = [
  "anyhow",
  "async-std",
diff --git a/Cargo.toml b/Cargo.toml
index 346b316d4dc..e786bb9f907 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -97,7 +97,7 @@ libp2p-pnet = { version = "0.24.0", path = "transports/pnet" }
 libp2p-quic = { version = "0.10.1", path = "transports/quic" }
 libp2p-relay = { version = "0.17.1", path = "protocols/relay" }
 libp2p-rendezvous = { version = "0.14.0", path = "protocols/rendezvous" }
-libp2p-request-response = { version = "0.26.0", path = "protocols/request-response" }
+libp2p-request-response = { version = "0.26.1", path = "protocols/request-response" }
 libp2p-server = { version = "0.12.4", path = "misc/server" }
 libp2p-swarm = { version = "0.44.0", path = "swarm" }
 libp2p-swarm-derive = { version = "=0.34.0", path = "swarm-derive" } # `libp2p-swarm-derive` may not be compatible with different `libp2p-swarm` non-breaking releases. E.g. `libp2p-swarm` might introduce a new enum variant `FromSwarm` (which is `#[non-exhaustive]`) in a non-breaking release. Older versions of `libp2p-swarm-derive` would not forward this enum variant within the `NetworkBehaviour` hierarchy. Thus the version pinning is required.
diff --git a/protocols/request-response/CHANGELOG.md b/protocols/request-response/CHANGELOG.md
index 30fc700da3c..65effe366e2 100644
--- a/protocols/request-response/CHANGELOG.md
+++ b/protocols/request-response/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.26.1 - unreleased
+- Derive `PartialOrd` and `Ord` for {Outbound,Inbound}RequestId.
+  See [PR XXXX](https://github.com/libp2p/rust-libp2p/pull/XXXX).
+
 ## 0.26.0
 
 - Remove `request_response::Config::set_connection_keep_alive` in favor of `SwarmBuilder::idle_connection_timeout`.
diff --git a/protocols/request-response/Cargo.toml b/protocols/request-response/Cargo.toml
index 2c7692fb9b4..6da25e24862 100644
--- a/protocols/request-response/Cargo.toml
+++ b/protocols/request-response/Cargo.toml
@@ -3,7 +3,7 @@ name = "libp2p-request-response"
 edition = "2021"
 rust-version = { workspace = true }
 description = "Generic Request/Response Protocols"
-version = "0.26.0"
+version = "0.26.1"
 authors = ["Parity Technologies <admin@parity.io>"]
 license = "MIT"
 repository = "https://github.com/libp2p/rust-libp2p"
diff --git a/protocols/request-response/src/lib.rs b/protocols/request-response/src/lib.rs
index 824839ebac8..fc68bd6cf1f 100644
--- a/protocols/request-response/src/lib.rs
+++ b/protocols/request-response/src/lib.rs
@@ -274,7 +274,7 @@ impl<TResponse> ResponseChannel<TResponse> {
 ///
 /// Note: [`InboundRequestId`]'s uniqueness is only guaranteed between
 /// inbound requests of the same originating [`Behaviour`].
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
 pub struct InboundRequestId(u64);
 
 impl fmt::Display for InboundRequestId {
@@ -287,7 +287,7 @@ impl fmt::Display for InboundRequestId {
 ///
 /// Note: [`OutboundRequestId`]'s uniqueness is only guaranteed between
 /// outbound requests of the same originating [`Behaviour`].
-#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
 pub struct OutboundRequestId(u64);
 
 impl fmt::Display for OutboundRequestId {