X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-invoice%2Fsrc%2Flib.rs;h=c01dfa47ba0b086f8de39691de88df06ce3f2e91;hb=22ea5053489f4a5fa82affbfc1cdf5d704136440;hp=4737173eef5da6e1f0ebdf16d8d235b536db4dce;hpb=a257906743d528c32c862b053b652d4b728aa990;p=rust-lightning diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index 4737173e..c01dfa47 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -297,7 +297,7 @@ pub struct RawInvoice { /// Data of the `RawInvoice` that is encoded in the human readable part /// -/// (C-not exported) As we don't yet support Option +/// (C-not exported) As we don't yet support `Option` #[derive(Eq, PartialEq, Debug, Clone, Hash)] pub struct RawHrp { /// The currency deferred from the 3rd and 4th character of the bech32 transaction @@ -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() }