Fix an off-by-one error

This commit is contained in:
Sami Samhuri 2020-01-02 18:34:29 -08:00
parent 0f6500cf2d
commit 9bebea8225

View file

@ -19,7 +19,7 @@ struct Month: Equatable {
let number: Int
init?(_ number: Int) {
guard number < Month.all.count else {
guard (1 ... Month.all.count).contains(number) else {
return nil
}
self.number = number