FR: drop chrono library for recommended jiff replacement #2547

Open
opened 2026-11-17 03:13:38 +00:00 by julian45 · 1 comment
Member

What new feature do you want to see? What problem does it solve?

Continuwuity currently depends on the chrono crate, which is soft-deprecated by its maintainer in favor of jiff. Jiff is maintained by BurntSushi, who brings some repute to the table: he maintains projects like ripgrep as well as other extant crates like aho-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 chrono is 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.rs might either take advantage of Jiff's offerings or potentially be obsoleted entirely.

Further reading

Additional context

No response

### What new feature do you want to see? What problem does it solve? Continuwuity currently depends on the `chrono` crate, which is [soft-deprecated by its maintainer](https://github.com/chronotope/chrono/issues/1768) in favor of [`jiff`](https://docs.rs/jiff/1.0.0/jiff/). Jiff is maintained by BurntSushi, who brings some repute to the table: he maintains projects like `ripgrep` as well as other extant crates like `aho-corasick`. Jiff [recently reached 1.0.0](https://burntsushi.net/jiff/); from my perspective, looking at that announcement as well as the [design rationale](https://docs.rs/jiff/latest/jiff/_documentation/design/index.html) and the [maintainer's comparison to other Rust date/time crates](https://docs.rs/jiff/latest/jiff/_documentation/comparison/), Jiff seems rather well thought-out. As far as current direct usage of `chrono` is concerned, it's used in this function: https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/fe0ab6212401f5a2a5bbcf01630181d75282fa9c/src/core/utils/time.rs#L58-L65 That function is then called in this other function (at line 51): https://forgejo.ellis.link/continuwuation/continuwuity/src/commit/e7b302955f4c4e3329f6d91c103b69ef58256619/src/database/engine/backup.rs#L40-L58 ...and so on. That being said, I wonder if some or all of the custom functions in `src/core/utils/time.rs` might either take advantage of Jiff's offerings or potentially be obsoleted entirely. ### Further reading - `chrono` soft-deprecation: https://github.com/chronotope/chrono/issues/1768 - `jiff` docs: https://docs.rs/jiff/1.0.0/jiff/ - jiff comparisons: https://docs.rs/jiff/latest/jiff/_documentation/comparison/ ### Additional context _No response_
Owner

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

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
nex changed title from bug(?): dependency chrono is soft-deprecated to FR: drop chrono library for recommended jiff replacement 2026-11-17 08:43:54 +00:00
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2547
No description provided.