From 793a1bf679b2631e215e7850bb1b35e727a69d0f Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 26 Sep 2023 21:12:46 +0000 Subject: [PATCH] Derive `Debug` and `Display` for `Route` --- lightning/src/routing/router.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index c20ce2e97..7862baf63 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -341,7 +341,7 @@ impl Path { /// A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP, /// it can take multiple paths. Each path is composed of one or more hops through the network. -#[derive(Clone, Hash, PartialEq, Eq)] +#[derive(Clone, Debug, Hash, PartialEq, Eq)] pub struct Route { /// The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no /// [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be @@ -380,6 +380,12 @@ impl Route { } } +impl fmt::Display for Route { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + log_route!(self).fmt(f) + } +} + const SERIALIZATION_VERSION: u8 = 1; const MIN_SERIALIZATION_VERSION: u8 = 1; -- 2.39.5