Skip to content

Commit

Permalink
Expose the default Quantity::one as pub
Browse files Browse the repository at this point in the history
  • Loading branch information
jkczyz committed Nov 11, 2022
1 parent 93d42a5 commit 391fa0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lightning/src/offers/offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -434,7 +435,8 @@ pub enum Quantity {
}

impl Quantity {
fn one() -> Self {
/// The default quantity of one.
pub fn one() -> Self {
Quantity::Bounded(NonZeroU64::new(1).unwrap())
}

Expand Down

0 comments on commit 391fa0b

Please sign in to comment.