BurntSushi / jiff

A date-time library for Rust that encourages you to jump into the pit of success.
The Unlicense
1.77k stars 35 forks source link

question: day_of_year why not return u16? #158

Closed TCeason closed 2 weeks ago

TCeason commented 2 weeks ago
#[inline]
    pub fn day_of_year(self) -> i16 {
        type DayOfYear = ri16<1, 366>;

        let days = C(1) + self.since_days_ranged(self.first_of_year());
        DayOfYear::rfrom(days).get()
    }

Maybe other function can also return unsigned number.

BurntSushi commented 2 weeks ago

Duplicate of #35, #102.