From defa2f6811c64b3c9fc3e8f375ccf4f0c4f09c3d Mon Sep 17 00:00:00 2001 From: Elias Rohrer Date: Fri, 13 Jan 2023 16:02:41 -0600 Subject: [PATCH] Fix misc. warnings from `--document-private-items` --- lightning-invoice/src/lib.rs | 6 +++++- lightning/src/ln/channel.rs | 2 +- lightning/src/ln/outbound_payment.rs | 2 +- lightning/src/ln/peer_handler.rs | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index dd0f5c3a..c01dfa47 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -806,6 +806,7 @@ impl SignedRawInvoice { /// /// The following example would extract the first B. /// +/// ```ignore /// enum Enum { /// A(u8), /// B(u16) @@ -814,6 +815,7 @@ impl SignedRawInvoice { /// let elements = vec![Enum::A(1), Enum::A(2), Enum::B(3), Enum::A(4)]; /// /// assert_eq!(find_extract!(elements.iter(), Enum::B(x), x), Some(3u16)); +/// ``` macro_rules! find_extract { ($iter:expr, $enm:pat, $enm_var:ident) => { find_all_extract!($iter, $enm, $enm_var).next() @@ -825,6 +827,7 @@ macro_rules! find_extract { /// /// The following example would extract all A. /// +/// ```ignore /// enum Enum { /// A(u8), /// B(u16) @@ -836,6 +839,7 @@ macro_rules! find_extract { /// find_all_extract!(elements.iter(), Enum::A(x), x).collect::>(), /// vec![1u8, 2u8, 4u8] /// ); +/// ``` macro_rules! find_all_extract { ($iter:expr, $enm:pat, $enm_var:ident) => { $iter.filter_map(|tf| match *tf { @@ -1276,7 +1280,7 @@ impl Invoice { self.signed_invoice.amount_pico_btc().map(|v| v / 10) } - /// Returns the amount if specified in the invoice as pico . + /// Returns the amount if specified in the invoice as pico BTC. fn amount_pico_btc(&self) -> Option { self.signed_invoice.amount_pico_btc() } diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 76dc1506..448fcd7f 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -798,7 +798,7 @@ pub const MAX_CHAN_DUST_LIMIT_SATOSHIS: u64 = MAX_STD_OUTPUT_DUST_LIMIT_SATOSHIS /// In order to avoid having to concern ourselves with standardness during the closing process, we /// simply require our counterparty to use a dust limit which will leave any segwit output /// standard. -/// See https://github.com/lightning/bolts/issues/905 for more details. +/// See for more details. pub const MIN_CHAN_DUST_LIMIT_SATOSHIS: u64 = 354; // Just a reasonable implementation-specific safe lower bound, higher than the dust limit. diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs index 2f643166..44415af3 100644 --- a/lightning/src/ln/outbound_payment.rs +++ b/lightning/src/ln/outbound_payment.rs @@ -60,7 +60,7 @@ pub(crate) enum PendingOutboundPayment { /// `PaymentPathFailed` events with `all_paths_failed` can be pending at once, confusing a /// downstream event handler as to when a payment has actually failed. /// - /// (1) https://github.com/lightningdevkit/rust-lightning/issues/1164 + /// (1) Abandoned { session_privs: HashSet<[u8; 32]>, payment_hash: PaymentHash, diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index d851d29d..0112a7d3 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -644,7 +644,7 @@ impl PeerManager" for an optional pubkey. +/// A simple wrapper that optionally prints ` from ` for an optional pubkey. /// This works around `format!()` taking a reference to each argument, preventing /// `if let Some(node_id) = peer.their_node_id { format!(.., node_id) } else { .. }` from compiling /// due to lifetime errors. @@ -656,8 +656,8 @@ impl core::fmt::Display for OptionalFromDebugger<'_> { } /// A function used to filter out local or private addresses -/// https://www.iana.org./assignments/ipv4-address-space/ipv4-address-space.xhtml -/// https://www.iana.org/assignments/ipv6-address-space/ipv6-address-space.xhtml +/// +/// fn filter_addresses(ip_address: Option) -> Option { match ip_address{ // For IPv4 range 10.0.0.0 - 10.255.255.255 (10/8) -- 2.30.2