Currently, HebrewDate's from_ymd and HebrewYear's get_hebrew_date use NonZeroI8. Really, it should have been NonZeroU8, but the truth is, that I don't think that either of the two are a good match for the following reasons:
- Quite often, I use
from_ymd on constants, where NonZeroU8 and NonZeroI8 are not very ergonomic (instead of 10, I have to use NonZeroI8::new(10).unwrap()).
- NonZero isn't truly expressive: I have to catch dates that are too big (and it's not a constant-number too big, some months have 29 days and some have 30), so I have to return an OutOfRange error anyways. So why catch OutOfRange in two places rather than one?
Currently, HebrewDate's
from_ymdand HebrewYear'sget_hebrew_dateuse NonZeroI8. Really, it should have been NonZeroU8, but the truth is, that I don't think that either of the two are a good match for the following reasons:from_ymdon constants, where NonZeroU8 and NonZeroI8 are not very ergonomic (instead of10, I have to useNonZeroI8::new(10).unwrap()).