Expose the default Quantity::one as pub
[rust-lightning] / lightning / src / offers / offer.rs
index 6b2dfe2aa5359770f18da167732a013a64857d3c..704045f760b02867e094026a3a0e87816bd82189 100644 (file)
@@ -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())
        }