From: Matt Corallo Date: Tue, 26 Sep 2023 21:12:46 +0000 (+0000) Subject: Derive `Debug` and `Display` for `Route` X-Git-Tag: v0.0.117-alpha2~1^2~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=793a1bf679b2631e215e7850bb1b35e727a69d0f;p=rust-lightning Derive `Debug` and `Display` for `Route` --- 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;