From: Elias Rohrer Date: Fri, 13 Jan 2023 22:02:41 +0000 (-0600) Subject: Fix misc. warnings from `--document-private-items` X-Git-Tag: v0.0.114-beta~62^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=defa2f6811c64b3c9fc3e8f375ccf4f0c4f09c3d;p=rust-lightning Fix misc. warnings from `--document-private-items` --- diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index dd0f5c3ab..c01dfa47b 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 76dc15065..448fcd7fe 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 2f6431665..44415af3d 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 d851d29d4..0112a7d31 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)