Skip to content

Commit 1e26a2b

Browse files
committed
Expose the default Quantity::one as pub
1 parent 94a07d9 commit 1e26a2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lightning/src/offers/offer.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ impl OfferBuilder {
185185
self
186186
}
187187

188-
/// Sets the quantity of items for [`Offer::supported_quantity`].
188+
/// Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to
189+
/// [`Quantity::one`].
189190
///
190191
/// Successive calls to this method will override the previous setting.
191192
pub fn supported_quantity(mut self, quantity: Quantity) -> Self {
@@ -425,7 +426,8 @@ pub enum Quantity {
425426
}
426427

427428
impl Quantity {
428-
fn one() -> Self {
429+
/// The default quantity of one.
430+
pub fn one() -> Self {
429431
Quantity::Bounded(NonZeroU64::new(1).unwrap())
430432
}
431433

0 commit comments

Comments
 (0)