From: Jeffrey Czyz Date: Fri, 11 Nov 2022 19:51:24 +0000 (-0600) Subject: Expose the default Quantity::one as pub X-Git-Tag: v0.0.113~36^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=1e26a2bc197207be512d905b05595492242b5f90;p=rust-lightning Expose the default Quantity::one as pub --- diff --git a/lightning/src/offers/offer.rs b/lightning/src/offers/offer.rs index 6b2dfe2aa..704045f76 100644 --- a/lightning/src/offers/offer.rs +++ b/lightning/src/offers/offer.rs @@ -185,7 +185,8 @@ impl OfferBuilder { self } - /// Sets the quantity of items for [`Offer::supported_quantity`]. + /// Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to + /// [`Quantity::one`]. /// /// Successive calls to this method will override the previous setting. pub fn supported_quantity(mut self, quantity: Quantity) -> Self { @@ -425,7 +426,8 @@ pub enum Quantity { } impl Quantity { - fn one() -> Self { + /// The default quantity of one. + pub fn one() -> Self { Quantity::Bounded(NonZeroU64::new(1).unwrap()) }