File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -439,15 +439,6 @@ impl Quantity {
439
439
Quantity :: Bounded ( NonZeroU64 :: new ( 1 ) . unwrap ( ) )
440
440
}
441
441
442
- fn new ( quantity : Option < u64 > ) -> Self {
443
- match quantity {
444
- None => Quantity :: one ( ) ,
445
- Some ( 0 ) => Quantity :: Unbounded ,
446
- Some ( 1 ) => unreachable ! ( ) ,
447
- Some ( n) => Quantity :: Bounded ( NonZeroU64 :: new ( n) . unwrap ( ) ) ,
448
- }
449
- }
450
-
451
442
fn to_tlv_record ( & self ) -> Option < u64 > {
452
443
match self {
453
444
Quantity :: Bounded ( n) => {
@@ -529,8 +520,10 @@ impl TryFrom<OfferTlvStream> for OfferContents {
529
520
} ;
530
521
531
522
let supported_quantity = match quantity_max {
523
+ None => Quantity :: one ( ) ,
524
+ Some ( 0 ) => Quantity :: Unbounded ,
532
525
Some ( 1 ) => return Err ( SemanticError :: InvalidQuantity ) ,
533
- _ => Quantity :: new ( quantity_max ) ,
526
+ Some ( n ) => Quantity :: Bounded ( NonZeroU64 :: new ( n ) . unwrap ( ) ) ,
534
527
} ;
535
528
536
529
if node_id. is_none ( ) {
You can’t perform that action at this time.
0 commit comments