FR: drop chrono library for recommended jiff replacement #2547
Labels
No labels
Abandoned
Blocked
Bug
Changelog
Added
Changelog
Missing
Changelog
None
Cherry-picking
Compliance
Database
Dependencies
Dependencies/Renovate
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/E2EE
Matrix/Federation
Matrix/Hydra
Matrix/MSC
Matrix/Media
Matrix/T&S
Merge
Merge/Manual
Merge/Squash
Meta
Meta/CI
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Support
bob the builder
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
continuwuation/continuwuity#2547
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What new feature do you want to see? What problem does it solve?
Continuwuity currently depends on the
chronocrate, which is soft-deprecated by its maintainer in favor ofjiff. Jiff is maintained by BurntSushi, who brings some repute to the table: he maintains projects likeripgrepas well as other extant crates likeaho-corasick. Jiff recently reached 1.0.0; from my perspective, looking at that announcement as well as the design rationale and the maintainer's comparison to other Rust date/time crates, Jiff seems rather well thought-out.As far as current direct usage of
chronois concerned, it's used in this function:#[must_use]pub fn rfc2822_from_seconds(epoch: i64) -> String {use chrono::{DateTime, Utc};DateTime::<Utc>::from_timestamp(epoch, 0).unwrap_or_default().to_rfc2822()}That function is then called in this other function (at line 51):
pub fn backup_list(&self) -> Result<impl Iterator<Item = String> + Send> {let info = self.backup_engine()?.get_backup_info();if info.is_empty() {return Err!("No backups found.");}let list = info.into_iter().map(|info| {format!("#{} {}: {} bytes, {} files",info.backup_id,rfc2822_from_seconds(info.timestamp),info.size,info.num_files,)});Ok(list)}...and so on.
That being said, I wonder if some or all of the custom functions in
src/core/utils/time.rsmight either take advantage of Jiff's offerings or potentially be obsoleted entirely.Further reading
chronosoft-deprecation: https://github.com/chronotope/chrono/issues/1768jiffdocs: https://docs.rs/jiff/1.0.0/jiff/Additional context
No response
BurntSushi rings a bell, I think I use(d) a golang parser lib of theirs? probably good stuff either way. I think switching to jiff would be sensible, although not really a priority given the mostly cosmetic use of chrono. Feel free to open a PR (you or anyone else)
Gonna change this to an enhancement request rather since a bug report since I don't think actually an impact on functionality here, rather it'd just be nice to switch
bug(?): dependency chrono is soft-deprecatedto FR: dropchronolibrary for recommendedjiffreplacement