by alexjarvis · 10y ago · 0 comments
guard item.count > 0 else {
throw VendingMachineError.OutOfStock
}
to if count == 0 {
throw VendingMachineError.OutOfStock
}
only proves that you can refactor the code to not use guard whereas the article starts by talking about small functions, where you could in fact still use guard in this case.