Skip to content

Commit dbab059

Browse files
committed
🟢 Add implementation for 0 subscriptions
1 parent 807ee95 commit dbab059

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

exercises/tiered_pricing/solutions/isaac1024_baby-steps/src/tiered_pricing.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ fn get_total_subscription_price(number_of_subscriptions: u32) -> Result<u32, Str
66
const FIFTH_UNIT_PRICE: u32 = 149;
77

88
match number_of_subscriptions {
9+
0 => Err("Error".to_string()),
910
1|2 => Ok(FIRST_UNIT_PRICE * number_of_subscriptions),
1011
3..=10 => Ok(SECOND_UNIT_PRICE * number_of_subscriptions),
1112
11..=25 => Ok(THIRD_UNIT_PRICE * number_of_subscriptions),

0 commit comments

Comments
 (0)