Commit activity
Last 12 weeks · 84 commits
Community health
3 of 6 standards met
Recent PRs & issues
Recent fixes
There are some possible performance footguns in the design of the type that could prevent Jiff from doing the fastest possible thing. There is some tension between API simplicity and borrowing data via a lifetime parameter. The two obvious candidates for borrowing are a 's value and a 's IANA time zone identifier. It also _seems_ like these two things could be merged, but IIRC, the IANA time zone identifier is a separate field to support parsing identifiers without necessarily eagerly turning it into a . But maybe that's not worth doing. In any case, we could explore adding a lifetime parameter to a . Today it has none. And if we did this, we'd likely need to put them inside wrappers and add routines for "borrowing" or "owning" a . This pattern is actually already used by Jiff in other less prominent places in the API. It can also be found in the crate. I don't really like doing this because I think lifetime/type parameters add cognitive overhead to understanding an API. It's precisely why Jiff is very light on such things already. And in the case of , there are likely only _some_ things that will be borrowed (the data that is non-, which can only come from a value), which makes it... somewhat weird. _With that said_, it is somewhat rare to need to interact with a directly, and it is considered a lower level API. So I'm definitely open to this. I really do not want to add _two_ lifetime parameters though (one for and one for ). If we didn't merge them, we could of course insist that they share a lifetime. Which is... probably reasonable. One thing I haven't thought too much about is the mutator APIs. Right now, for example, mutates the value in place. I think this is still doable with a lifetime parameter, but I'd want to play around with it. We could alternatively only provide the mutator API on . See #494 for an attempt at a change like this and some ensuing discussion.
Repository: BurntSushi/jiff. Description: A datetime library for Rust that encourages you to jump into the pit of success. Stars: 3055, Forks: 141. Primary language: Rust. Languages: Rust (99.5%), Shell (0.4%), Lua (0%). License: Unlicense. Topics: calendar, civil, date, date-time, datetime, duration, iana, iso8601, jiff, local, rfc2822, rust, strftime, strptime, temporal, time, timezone, tzdb, utc, zone. Open PRs: 0, open issues: 12. Last activity: 14h ago. Community health: 57%. Top contributors: BurntSushi, fiadliel, musicinmybrain, benjoffe, LeoniePhiline, 1996fanrui, Marsman1996, tisonkun, robertbastian, dickermoshe and others.