Skip to content

Change day to u8 #1

Description

@heca-project

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:

  1. 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()).
  2. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions