commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
1724addc4e1aa019a5ef068ba38b30db70e936e0 | Kyle Mayes | 2016-05-16T19:05:04 | Reduce required Clang static libraries | diff --git a/build.rs b/build.rs
index 051ab37..800ceb4 100644
--- a/build.rs
+++ b/build.rs
@@ -94,26 +94,18 @@ fn find(file: &str, env: &str) -> Option<String> {
/// Clang libraries required to link to libclang statically.
const CLANG_LIBRARIES: &'static [&'static str] = &[
"clang",
- "clangARCMigrate",
... | 1 | 0 | 8 |
d3d85ec5f3f4e45574a012ff2a0d282a49c24756 | Kyle Mayes | 2016-05-15T21:08:52 | Refactor | diff --git a/build.rs b/build.rs
index d21d4ca..051ab37 100644
--- a/build.rs
+++ b/build.rs
@@ -5,14 +5,19 @@ use std::process::{Command};
// Environment variables:
//
// * LLVM_CONFIG_PATH - provides a path to an `llvm-config` executable
-// * LIBCLANG_PATH - provides a path to a libclang dynamic library
-// * LIB... | 1 | 31 | 21 |
bcc694fba2e1cf89eca9a4a96581178f39f34b82 | Kyle Mayes | 2016-05-11T01:21:34 | Simplify build.rs | diff --git a/build.rs b/build.rs
index 0234df8..6445d43 100644
--- a/build.rs
+++ b/build.rs
@@ -30,13 +30,15 @@ fn error(prefix: &str) -> ! {
panic!("{:?}, set the LIBCLANG_PATH environment variable to your system's libclang directory", prefix);
}
+/// Runs a console command, returning the output if the comman... | 1 | 11 | 13 |
c427881a0bcc8df491e20d591a8c6b417a18a848 | Kyle Mayes | 2016-05-10T18:32:11 | Fix target_os value for OS X | diff --git a/build.rs b/build.rs
index e10d335..faf9d92 100644
--- a/build.rs
+++ b/build.rs
@@ -44,7 +44,7 @@ fn find_libclang() -> Option<(String, String)> {
} else {
if cfg!(any(target_os="freebsd", target_os="linux")) {
SEARCH_LINUX
- } else if cfg!(target_os="osx") {
+ } el... | 1 | 1 | 1 |
8eed98fc9da3996718bb68e553db3b383c4036c3 | Kyle Mayes | 2016-05-10T18:31:47 | Reformat | diff --git a/build.rs b/build.rs
index 8a10070..e10d335 100644
--- a/build.rs
+++ b/build.rs
@@ -40,10 +40,7 @@ fn find_libclang() -> Option<(String, String)> {
let search = if let Ok(directory) = env::var("LIBCLANG_PATH") {
vec![directory]
} else if let Some(output) = run("llvm-config", &["--libdir"... | 1 | 3 | 14 |
3ad0dc71e3696e2968faeb8fe8828855999d96cd | Yamakaky | 2016-05-10T18:29:34 | Improve find_libclang (#11) | diff --git a/build.rs b/build.rs
index 2fc45e9..8a10070 100644
--- a/build.rs
+++ b/build.rs
@@ -39,32 +39,33 @@ fn run(command: &str, arguments: &[&str]) -> Option<String> {
fn find_libclang() -> Option<(String, String)> {
let search = if let Ok(directory) = env::var("LIBCLANG_PATH") {
vec![directory]
+... | 1 | 23 | 22 |
6ca6f9f53313678bfeaa10424e2ea13e764819b2 | Kyle Mayes | 2016-05-09T23:17:27 | Readd Linux backup search paths | diff --git a/build.rs b/build.rs
index e618603..2fc45e9 100644
--- a/build.rs
+++ b/build.rs
@@ -2,6 +2,19 @@ use std::env;
use std::path::{Path};
use std::process::{Command};
+const SEARCH_LINUX: &'static [&'static str] = &[
+ "/usr/lib",
+ "/usr/lib/llvm",
+ "/usr/lib/llvm-3.8/lib",
+ "/usr/lib/llvm-3... | 1 | 17 | 6 |
cb0b2e521201bfd67f54d24cbe1e749c6b1e5508 | Kyle Mayes | 2016-05-09T23:02:48 | Improve build.rs error messages | diff --git a/build.rs b/build.rs
index 1b77fd3..0e12544 100644
--- a/build.rs
+++ b/build.rs
@@ -13,6 +13,10 @@ const SEARCH_WINDOWS: &'static [&'static str] = &[
"C:\\Program Files\\LLVM\\lib",
];
+fn error(prefix: &str) -> ! {
+ panic!("{:?}, set the LIBCLANG_PATH environment variable to your system's libc... | 1 | 15 | 9 |
33f6615a6cf52d984accda0d3c5d40e00ec54b2c | Yamakaky | 2016-05-09T22:54:20 | Remove rustc_version dependency (#8) | diff --git a/Cargo.toml b/Cargo.toml
index 3724dac..5b17d51 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,7 +32,3 @@ static = []
bitflags = "0.6.0"
libc = "0.2.11"
-
-[build-dependencies]
-
-rustc_version = "0.1.7"
diff --git a/build.rs b/build.rs
index 455a4bf..1b77fd3 100644
--- a/build.rs
+++ b/build.rs
@@ -1,... | 2 | 0 | 6 |
1c513da3dc7ad082116d630c5b5b306ff1640c0a | Yamakaky | 2016-05-09T22:48:45 | Improve build (#7)
Improve build.rs | diff --git a/build.rs b/build.rs
index 5607584..455a4bf 100644
--- a/build.rs
+++ b/build.rs
@@ -4,19 +4,6 @@ use std::env;
use std::path::{Path};
use std::process::{Command};
-const SEARCH_LINUX: &'static [&'static str] = &[
- "/usr/lib",
- "/usr/lib/llvm",
- "/usr/lib/llvm-3.8/lib",
- "/usr/lib/llvm-3... | 1 | 26 | 59 |
28af5f3a2a4cc7aaaa28155812f37a1093eeea82 | Kyle Mayes | 2016-03-16T20:21:09 | Bump libc version | diff --git a/Cargo.toml b/Cargo.toml
index 25311fb..b7bf101 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,7 +30,7 @@ gte_clang_3_8 = []
[dependencies]
bitflags = "0.5.0"
-libc = "0.2.7"
+libc = "0.2.8"
[build-dependencies] | 1 | 1 | 1 |
c0435327c4bcb8437bd3dd53259943e0559974ed | Kyle Mayes | 2016-03-16T20:20:20 | Bump bitflags version | diff --git a/Cargo.toml b/Cargo.toml
index 5b487bc..25311fb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,7 @@ gte_clang_3_8 = []
[dependencies]
-bitflags = "0.4.0"
+bitflags = "0.5.0"
libc = "0.2.7"
[build-dependencies]
diff --git a/src/lib.rs b/src/lib.rs
index 3d9dcf7..09298b4 100644
--- a/src/lib.r... | 2 | 14 | 14 |
cf4e8e62945a1cc6670b8e798cb1fb4f649af4db | Kyle Mayes | 2016-02-14T00:21:13 | Bump rustc_version version | diff --git a/Cargo.toml b/Cargo.toml
index ce886c8..1adedda 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -34,4 +34,4 @@ libc = "0.2.7"
[build-dependencies]
-rustc_version = "0.1.4"
+rustc_version = "0.1.6" | 1 | 1 | 1 |
6282fcd50a38fa552d7989a89ef37998ef1e933e | Kyle Mayes | 2016-02-14T00:21:04 | Bump libc version | diff --git a/Cargo.toml b/Cargo.toml
index 82f10ac..ce886c8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,7 +30,7 @@ gte_clang_3_8 = []
[dependencies]
bitflags = "0.4.0"
-libc = "0.2.4"
+libc = "0.2.7"
[build-dependencies] | 1 | 1 | 1 |
223b01e3caf4eed4fe3f758633c268eba1ffb415 | Kyle Mayes | 2016-02-14T00:20:54 | Bump bitflags version | diff --git a/Cargo.toml b/Cargo.toml
index fe13fce..82f10ac 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,7 @@ gte_clang_3_8 = []
[dependencies]
-bitflags = "0.3.3"
+bitflags = "0.4.0"
libc = "0.2.4"
[build-dependencies] | 1 | 1 | 1 |
5178d195b750b2dd471db9ba53e8a36f84801d72 | Kyle Mayes | 2015-12-30T02:11:06 | Remove unnecessary lint attributes | diff --git a/src/lib.rs b/src/lib.rs
index ff98b43..4cf1ec3 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -9,7 +9,7 @@
//! The documentation for the non-version specific API is
//! [here](https://kylemayes.github.io/clang-sys/all/clang_sys).
-#![allow(missing_debug_implementations, missing_docs, non_upper_case_global... | 1 | 1 | 1 |
5b53a23bcfdadd4ab17b53db3d7851ddddf33f84 | Kyle Mayes | 2015-12-26T17:36:40 | Bump version | diff --git a/Cargo.toml b/Cargo.toml
index 2e0a363..40b65d2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,7 @@
name = "clang-sys"
authors = ["Kyle Mayes <kyle@mayeses.com>"]
-version = "0.1.0"
+version = "0.1.1"
readme = "README.md"
license = "MIT" | 1 | 1 | 1 |
ff234140412e9e57326ad65f06addec8d8d78266 | Andrew Gallant | 2026-03-03T23:28:02 | jiff-tzdb-0.1.6 | diff --git a/crates/jiff-tzdb/Cargo.toml b/crates/jiff-tzdb/Cargo.toml
index 7330144..8d87683 100644
--- a/crates/jiff-tzdb/Cargo.toml
+++ b/crates/jiff-tzdb/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jiff-tzdb"
-version = "0.1.5" #:version
+version = "0.1.6" #:version
authors = ["Andrew Gallant <jamslam@gmail.c... | 1 | 1 | 1 |
c3d960e1922b9c88bfd8e50f061df4987503c4dd | Andrew Gallant | 2026-02-22T20:32:50 | fuzz: update dependencies | diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock
index 1f8d01d..f3f1d14 100644
--- a/fuzz/Cargo.lock
+++ b/fuzz/Cargo.lock
@@ -13,9 +13,9 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.2.55"
+version = "1.2.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47b26a0954ae34af0... | 1 | 10 | 10 |
9e766682f9347a26ba9d3a97ea4d75427a60c645 | Dennis Waldherr | 2026-02-22T20:29:34 | civil: check for `days < 1` in `Date::new`
Fixes #523 | diff --git a/src/civil/date.rs b/src/civil/date.rs
index fc90f0e..739f934 100644
--- a/src/civil/date.rs
+++ b/src/civil/date.rs
@@ -246,7 +246,7 @@ impl Date {
pub fn new(year: i16, month: i8, day: i8) -> Result<Date, Error> {
let year = b::Year::check(year)?;
let month = b::Month::check(month)?... | 1 | 17 | 1 |
d57657ab903fa94eb17ce669605ee3116a0070ec | Ben Joffe | 2026-02-18T01:19:09 | perf: optimize timestamp -> datetime conversion
Essentially, division and remainder operations are a lot slower when dealing with signed integers than unsigned.
By using a positive offset bias in the ITimestamp to_datetime function, to convert the seconds to unsigned, I have found that the timestamp/to_civil_datetime_... | diff --git a/crates/jiff-static/src/shared/util/itime.rs b/crates/jiff-static/src/shared/util/itime.rs
index b320234..2009524 100644
--- a/crates/jiff-static/src/shared/util/itime.rs
+++ b/crates/jiff-static/src/shared/util/itime.rs
@@ -49,9 +49,19 @@ impl ITimestamp {
#[cfg_attr(feature = "perf-inline", inline(al... | 2 | 156 | 6 |
b6977a12f2bba57b128e351bc307de8c924f9cfa | Andrew Gallant | 2026-02-11T16:59:10 | examples: add program demonstrating Diesel footgun with `TIMESTAMP WITHOUT TIME ZONE` values
I wrote this example to demonstrate precisely why it's inappropriate
for Jiff to provide trait implementations permitting interoperation
between `jiff::Timestamp` and `TIMESTAMP WITHOUT TIME ZONE` values in
PostgreSQL.
Ref #5... | diff --git a/examples/diesel-postgres-timestamp-confusion/Cargo.toml b/examples/diesel-postgres-timestamp-confusion/Cargo.toml
new file mode 100644
index 0000000..b0b2c96
--- /dev/null
+++ b/examples/diesel-postgres-timestamp-confusion/Cargo.toml
@@ -0,0 +1,20 @@
+[package]
+publish = false
+name = "diesel-postgres-tim... | 3 | 168 | 2 |
4c33013130c19211e46db561e233666bacf69309 | Andrew Gallant | 2026-02-09T17:32:43 | cargo: remove `js` feature from Playground metadata
OK, seems like we might not want or need it:
https://github.com/BurntSushi/jiff/issues/502#issuecomment-3872930901 | diff --git a/Cargo.toml b/Cargo.toml
index fb5bd8d..8ab6888 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -291,7 +291,7 @@ rustdoc-args = ["--cfg", "docsrs_jiff"]
# Ref: https://github.com/BurntSushi/jiff/issues/502
[package.metadata.playground]
default-features = true
-features = ["js", "logging", "serde", "static", ... | 1 | 1 | 1 |
ea994edcf44054f5b6a392131b8fa3321b8f6ec5 | Andrew Gallant | 2026-02-02T20:00:49 | zoned: rip ranged integers out of time zone aware datetimes | diff --git a/src/util/b.rs b/src/util/b.rs
index 17163f5..a438d73 100644
--- a/src/util/b.rs
+++ b/src/util/b.rs
@@ -360,6 +360,26 @@ define_bounds! {
(YearCE, i16, "CE year", 1, Year::MAX),
(YearBCE, i16, "BCE year", 1, Year::MAX + 1),
(YearTwoDigit, i16, "year (2 digits)", 0, 99),
+ (
+ Zoned... | 5 | 68 | 122 |
8917c86eb2ea55550c7d08ed173089778b9efc78 | Andrew Gallant | 2026-02-02T00:46:59 | civil: rip ranged integers out of `civil::DateTime` | diff --git a/src/civil/datetime.rs b/src/civil/datetime.rs
index b57874b..e9b1180 100644
--- a/src/civil/datetime.rs
+++ b/src/civil/datetime.rs
@@ -12,11 +12,7 @@ use crate::{
},
shared::util::itime::IDateTime,
tz::TimeZone,
- util::{
- rangeint::{RFrom, RInto},
- round::increment,
- ... | 3 | 62 | 94 |
ea566c87cd33c42b0c1610dcc47345e52ab96bd3 | Andrew Gallant | 2026-01-23T19:59:32 | civil: rip ranged integers out of `civil::Weekday` | diff --git a/src/civil/date.rs b/src/civil/date.rs
index ebbcbe7..45a16ce 100644
--- a/src/civil/date.rs
+++ b/src/civil/date.rs
@@ -344,9 +344,9 @@ impl Date {
UnixEpochDay::borked(iso_week_start_from_year(weekdate.year()));
let year = t::NoUnits16::borked(weekdate.year());
let week = t:... | 5 | 69 | 130 |
b151db3ff9becc8707e904f83875e2756ee80046 | Andrew Gallant | 2026-01-20T01:33:55 | civil: rip ranged integers out of `civil::ISOWeekDate`
The code is in a bit of a mess. I'll loop back around to do some
clean-up after ranged integers are completely gone. | diff --git a/src/civil/date.rs b/src/civil/date.rs
index db5b80f..ebbcbe7 100644
--- a/src/civil/date.rs
+++ b/src/civil/date.rs
@@ -11,6 +11,7 @@ use crate::{
shared::util::itime::{self, IDate, IEpochDay},
tz::TimeZone,
util::{
+ b,
rangeint::{self, Composite, RFrom, RInto, TryRFrom},
... | 5 | 138 | 234 |
6bd2c0997f18f21cbb1fab812ae39da70a0a9351 | Andrew Gallant | 2026-01-19T19:19:50 | rangeint: various other small removals of ranged integers
I think these are the last remaining low hanging fruits. | diff --git a/src/lib.rs b/src/lib.rs
index f285640..06336ea 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -812,38 +812,38 @@ mod tests {
#[cfg(feature = "std")]
#[test]
fn ranges() {
- use crate::util::t;
-
- dbg!((t::SpanYears::MIN, t::SpanYears::MAX));
- dbg!((t::SpanMonths::MIN, t::... | 4 | 47 | 32 |
9c6306ef7404298dd287f2b2791dd369d2e334cb | Andrew Gallant | 2026-01-19T18:50:38 | span: remove `b::Sign::as_ranged_integer()`
We just inline the implementation since it's only used once. We'll get
get rid of `t::Sign` eventually. | diff --git a/src/fmt/util.rs b/src/fmt/util.rs
index 95d32d7..391e64d 100644
--- a/src/fmt/util.rs
+++ b/src/fmt/util.rs
@@ -233,7 +233,7 @@ impl DurationUnits {
// The unchecked setters above don't manipulate
// the sign, which defaults to zero. So we need to
// set it even when it's positiv... | 3 | 8 | 11 |
e9412fb111e0e2b2e96e03e3ebdd7bd54a9ba20a | Andrew Gallant | 2026-01-17T15:46:16 | round: implement the core rounding primitives without ranged integers
I tried to switch them more toward using `SignedDuration`, but because
increment is an `i64`, it's possible to overflow `SignedDuration`. So we
stick to `i128` for the time being.
(I kind of wonder if we should switch `increment` to `i32`, but that... | diff --git a/src/civil/datetime.rs b/src/civil/datetime.rs
index 5bdb347..28e11ea 100644
--- a/src/civil/datetime.rs
+++ b/src/civil/datetime.rs
@@ -3523,7 +3523,7 @@ impl DateTimeRound {
// ref: https://tc39.es/proposal-temporal/#sec-temporal.plaindatetime.prototype.round
let increment =
- ... | 10 | 251 | 263 |
1eecb4714462f0e75f1606039abce803a54df623 | Andrew Gallant | 2026-01-17T02:20:13 | span: rewrite `Span::from_invariant_seconds`
We now use a `SignedDuration`, which means we can farm out the
math to it. (I expect this to be a recurring refactoring pattern in the
near term.)
This also simplifies the logic and drops LLVM lines by ~700 in my Biff
benchark. I wouldn't be surprised if this were faster t... | diff --git a/src/signed_duration.rs b/src/signed_duration.rs
index 8ad02d9..a97d3f5 100644
--- a/src/signed_duration.rs
+++ b/src/signed_duration.rs
@@ -2327,6 +2327,54 @@ impl SignedDuration {
SignedDuration::from_secs((mins as i64) * SECS_PER_MINUTE)
}
+ /// Returns the number of whole civil weeks ... | 4 | 100 | 261 |
f598b82db796dc3cc21f6bf167dda769a7021916 | Andrew Gallant | 2026-01-16T23:10:57 | span: simplify `Span::from_invariant_nanoseconds`
... with the idea of switching it to use `SignedDuration`.
This might also reduce code size? Indeed, in my Biff benchmark,
`Span::from_invariant_nanoseconds` reduces from 767 LLVM lines
to 320 lines. | diff --git a/src/span.rs b/src/span.rs
index 3d6695e..b2bf25a 100644
--- a/src/span.rs
+++ b/src/span.rs
@@ -2878,148 +2878,54 @@ impl Span {
nanos: NoUnits128,
) -> Result<Span, Error> {
let mut span = Span::new();
- match largest {
- Unit::Week => {
- let micros... | 1 | 47 | 141 |
73f1721812f355066976bd4f8ee1d39570a30a69 | Andrew Gallant | 2026-01-16T16:12:06 | timestamp: optimize adding `Span` to `Timestamp`
The `timestamp/add_time_secs/span/jiff` benchmark regressed a little bit
from the previous commit. It looks like something changed that caused
more copying of `Span` values. In this commit, we regain that perf by
being more explicit with `&Span`. | diff --git a/bench/src/timestamp.rs b/bench/src/timestamp.rs
index 33fb01f..75a66d0 100644
--- a/bench/src/timestamp.rs
+++ b/bench/src/timestamp.rs
@@ -12,6 +12,7 @@ use crate::{benchmark, convert::ConvertFrom};
pub(super) fn define(c: &mut Criterion) {
add_time_secs(c);
+ sub_time_secs(c);
add_time_su... | 10 | 91 | 56 |
c1e922e89933bd2fc7c0d61163e729cdc208dbda | Andrew Gallant | 2026-01-14T21:45:35 | tz: rip ranged integers out of `jiff::tz::Offset` implementation
This was a little harder, but still not too bad. This also begins
starting to rip ranged integers out of some other places, including
beginning to reduce the uses of the cursed `Composite` API used for
converting to and from values which use multiple ran... | diff --git a/src/civil/datetime.rs b/src/civil/datetime.rs
index f44d1ec..a6a932e 100644
--- a/src/civil/datetime.rs
+++ b/src/civil/datetime.rs
@@ -13,7 +13,7 @@ use crate::{
shared::util::itime::IDateTime,
tz::TimeZone,
util::{
- rangeint::{Composite, RFrom, RInto},
+ rangeint::{RFrom, RI... | 12 | 464 | 226 |
d89d40a4e23381adf57e1d6bd8bb5740021c46ce | Andrew Gallant | 2026-01-13T02:15:05 | util: use named constants more consistently
At least, for defining the boundaries.
There are more places where we don't use "basic" constants and still
write out "magic" numbers. Usually they are very well known though, so I
don't feel too bad about it. | diff --git a/src/util/b.rs b/src/util/b.rs
index 2276184..15a2c33 100644
--- a/src/util/b.rs
+++ b/src/util/b.rs
@@ -9,22 +9,32 @@ ranged integers. I'm not quite sure where this will go.
use crate::{util::t, Error};
+pub(crate) const DAYS_PER_WEEK: i64 = 7;
+pub(crate) const HOURS_PER_CIVIL_DAY: i64 = 24;
pub(cra... | 1 | 29 | 19 |
340baa547b4cf5efa787cd3eac18954e36df1774 | Andrew Gallant | 2026-01-13T02:06:25 | tz: rip ranged integers out of timezone representation internals
This was easy. | diff --git a/src/tz/timezone.rs b/src/tz/timezone.rs
index 9c2e4e8..f06f8d1 100644
--- a/src/tz/timezone.rs
+++ b/src/tz/timezone.rs
@@ -1938,10 +1938,7 @@ impl<'t> TimeZoneAbbreviation<'t> {
mod repr {
use core::mem::ManuallyDrop;
- use crate::{
- tz::tzif::TzifStatic,
- util::{constant::unwra... | 1 | 3 | 7 |
23c879a5881a7c605627818f6f7ee1635eeb95f3 | Andrew Gallant | 2026-01-13T02:01:48 | tz: rip ranged integers out of Zic parser
It's so sad keeping this up to date. I haven't touched it since my
initial push to build a Zic compiler. I'd love to revisit it and
complete it... some day. | diff --git a/src/tz/zic.rs b/src/tz/zic.rs
index dc702f3..73a240d 100644
--- a/src/tz/zic.rs
+++ b/src/tz/zic.rs
@@ -98,7 +98,7 @@ in such cases.
[Time Zone Database]: https://www.iana.org/time-zones
*/
-#![allow(warnings)]
+#![allow(dead_code)]
use core::{ops::RangeInclusive, str::FromStr};
@@ -118,12 +118,7 ... | 1 | 131 | 168 |
77ec9cf3fea7ec16bba8c56d8c972b34393d1803 | Andrew Gallant | 2026-02-07T18:59:36 | cargo: add `js` feature to Rust Playground deployment
Because it's being used already:
https://github.com/rust-lang/rust-playground/blob/f0d85ff3b04992974c8ef4ff72be4f27c47ec7c5/compiler/base/Cargo.toml#L899-L903
This also means that enabling `tz-system` should work. That is, it
should fetch the "system" time zone fr... | diff --git a/Cargo.toml b/Cargo.toml
index 8ab6888..fb5bd8d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -291,7 +291,7 @@ rustdoc-args = ["--cfg", "docsrs_jiff"]
# Ref: https://github.com/BurntSushi/jiff/issues/502
[package.metadata.playground]
default-features = true
-features = ["logging", "serde", "static", "tzdb-... | 1 | 1 | 1 |
3c9ba667390a1f3aeb104fb9110475defa609bb0 | Andrew Gallant | 2026-02-01T17:23:49 | zoned: kinda optimize `Zoned::default()`
This adds a benchmark that just calls `Zoned::default()` and internally
changes its implementation to return a `const` value.
Interestingly, the benchmark measurement result remains unchanged. It
seems like the compiler was actually seeing through the
`Zoned::new(Timestamp::de... | diff --git a/bench/src/zoned.rs b/bench/src/zoned.rs
index 6d02af4..cb34192 100644
--- a/bench/src/zoned.rs
+++ b/bench/src/zoned.rs
@@ -10,11 +10,43 @@ use jiff::{
use crate::{benchmark, convert::ConvertFrom};
pub(super) fn define(c: &mut Criterion) {
+ default(c);
fixed_offset_add_time(c);
fixed_offs... | 2 | 49 | 19 |
66ba0fe164c91082d63bb2687c41629bb125bd26 | Andrew Gallant | 2026-01-12T22:04:58 | fmt: rip ranged integers out of Temporal RFC 9557 parser
The `jiff::fmt` module is now completely free of ranged integer types.
w00t.
Easier than I expected, but I also suspected this would be one of the
easier parts of the migration since `jiff::fmt` lives at the boundaries. | diff --git a/src/error/fmt/temporal.rs b/src/error/fmt/temporal.rs
index 4f0cd34..d94fbfe 100644
--- a/src/error/fmt/temporal.rs
+++ b/src/error/fmt/temporal.rs
@@ -63,17 +63,9 @@ pub(crate) enum Error {
FailedYearInDate,
FailedYearInYearMonth,
InvalidDate,
- InvalidDay,
- InvalidHour,
- Invalid... | 4 | 89 | 126 |
a651ac732666cd4ebe0a5dbc2b5dcde0088632cf | Andrew Gallant | 2026-01-12T22:00:11 | error: update `Error::is_range` predicate
This should now include the new `Bounds` error type. | diff --git a/src/error/mod.rs b/src/error/mod.rs
index 8406a5e..e72ae14 100644
--- a/src/error/mod.rs
+++ b/src/error/mod.rs
@@ -111,7 +111,10 @@ impl Error {
/// ```
pub fn is_range(&self) -> bool {
use self::ErrorKind::*;
- matches!(*self.root().kind(), Range(_) | SlimRange(_) | ITimeRange(_... | 1 | 4 | 1 |
c2dcbca9f8a2619e130581d5b787c6de9a3e55e2 | Andrew Gallant | 2026-01-12T21:05:50 | fmt: refactor Temporal parser to get rid of input capture
I did this originally to aid error messages by reflecting back precisely
what was in the input. But I've been trending away from that, and we
should be able to get most of the value here by just using the `Display`
impls of what we parsed. That's what we do her... | diff --git a/src/fmt/offset.rs b/src/fmt/offset.rs
index 9d6df16..149a627 100644
--- a/src/fmt/offset.rs
+++ b/src/fmt/offset.rs
@@ -181,6 +181,17 @@ impl ParsedOffset {
}
}
+impl core::fmt::Display for ParsedOffset {
+ fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
+ match self.ki... | 3 | 120 | 160 |
d439a66e87e3e62e5b6ca4d86a5353fd5a500b9c | Andrew Gallant | 2026-01-11T22:12:52 | fmt: rename `strtime::format` to `strtime::print`
This was driving be bonkers. Everything else uses `print.rs` (when
parsing and printing are in separate modules). | diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs
index acc085b..383be5b 100644
--- a/src/fmt/strtime/mod.rs
+++ b/src/fmt/strtime/mod.rs
@@ -279,7 +279,7 @@ use crate::{
error::{fmt::strtime::Error as E, ErrorContext},
fmt::{
buffer::{ArrayBuffer, BorrowedWriter},
- strtime::{forma... | 2 | 2 | 2 |
16da5e8ed939e959333822172a5e2e6b87290c5d | Andrew Gallant | 2026-01-11T22:05:53 | fmt: rip ranged integers out of time zone offset parser
This also rips them out of the utility functions in `fmt`. (This was
already intentionally quite light on ranged integer usage, since I had
written that code recently and figured I'd be ripping things out.) This
did require defining more bounds types, including, ... | diff --git a/src/error/fmt/offset.rs b/src/error/fmt/offset.rs
index af81804..785633b 100644
--- a/src/error/fmt/offset.rs
+++ b/src/error/fmt/offset.rs
@@ -21,9 +21,6 @@ pub(crate) enum Error {
ParseMinutes,
ParseSeconds,
PrecisionLoss,
- RangeHours,
- RangeMinutes,
- RangeSeconds,
Separat... | 5 | 240 | 119 |
05f991a79315e2315064475824556ca06ed1ed26 | Andrew Gallant | 2026-01-11T19:55:57 | fmt: rip ranged integers out of RFC 2822 parsing
This continues the journey started in 808905c5. | diff --git a/src/error/fmt/rfc2822.rs b/src/error/fmt/rfc2822.rs
index 764b267..ab2ab16 100644
--- a/src/error/fmt/rfc2822.rs
+++ b/src/error/fmt/rfc2822.rs
@@ -19,15 +19,9 @@ pub(crate) enum Error {
FailedZoned,
InconsistentWeekday { parsed: Weekday, from_date: Weekday },
InvalidDate,
- InvalidHour,
... | 3 | 180 | 77 |
bd32085efeb12ba22871c939200ab25358dc5d64 | Andrew Gallant | 2026-01-10T01:34:43 | fuzz: bump dependencies | diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock
index 8f2fadd..8edaaed 100644
--- a/fuzz/Cargo.lock
+++ b/fuzz/Cargo.lock
@@ -13,9 +13,9 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.2.50"
+version = "1.2.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f50d563227a1c37c... | 1 | 16 | 16 |
efe4616a2a0b956ea1db1b5beaa78aaed30339fd | Andrew Gallant | 2026-01-06T22:09:44 | rangeint: switch `/` and `%` operators to match std
When I first devised the rangeint abstraction, I somewhat unwisely made
its `/` and `%` operators use eucilidean division instead of matching
what `std` does (which always rounds the result toward zero). I did
this because I thought it was going to be overwhelmingly ... | diff --git a/src/civil/date.rs b/src/civil/date.rs
index 2dc1a73..42535df 100644
--- a/src/civil/date.rs
+++ b/src/civil/date.rs
@@ -3654,8 +3654,8 @@ fn month_add_overflowing(
) -> (t::Month, t::SpanYears) {
let month = t::SpanMonths::rfrom(month);
let total = month - C(1) + span;
- let years = total / C... | 5 | 41 | 18 |
d8e765bd78c60f60e9320f021e3560e1a47741a4 | Andrew Gallant | 2026-01-04T21:07:51 | fmt: use `impl Into<u64>` for some routines on `BorrowedBuffer`
I had previously not done this thinking that it would be advantageous
for these routines to be monomorphic. But in the end, these all end up
getting forced to be inlined, which means we might as well make the call
sites more ergonomic.
This doesn't have ... | diff --git a/src/fmt/buffer.rs b/src/fmt/buffer.rs
index cc10031..fb5176e 100644
--- a/src/fmt/buffer.rs
+++ b/src/fmt/buffer.rs
@@ -243,7 +243,8 @@ impl<'data> BorrowedBuffer<'data> {
/// When the available space is insufficient to encode the number of
/// digits in the decimal representation of `n`.
#[... | 6 | 104 | 116 |
79de86aa86faf157de15da0201f36d828eeb6add | Andrew Gallant | 2026-01-04T20:51:04 | fmt: improve SAFETY comments
I switched up the implementation here a few commits ago, but forgot to
update the SAFETY comments. | diff --git a/src/fmt/buffer.rs b/src/fmt/buffer.rs
index f405d9c..cc10031 100644
--- a/src/fmt/buffer.rs
+++ b/src/fmt/buffer.rs
@@ -391,7 +391,10 @@ impl<'data> BorrowedBuffer<'data> {
.get_mut(..2)
.expect("padded 2 digit integer exceeds available buffer space");
let radix_offset = ... | 1 | 16 | 4 |
52ad94e9490d51fad230c5d24ce1ee1c292e2ee0 | Andrew Gallant | 2026-01-04T20:49:06 | fmt: use `MaybeUninit::write` in lieu of `MaybeUninit::new`
I forgot about the `write` API, which is often more convenient. | diff --git a/src/fmt/buffer.rs b/src/fmt/buffer.rs
index b58ecb0..f405d9c 100644
--- a/src/fmt/buffer.rs
+++ b/src/fmt/buffer.rs
@@ -229,11 +229,10 @@ impl<'data> BorrowedBuffer<'data> {
#[cfg_attr(feature = "perf-inline", inline(always))]
pub(crate) fn write_ascii_char(&mut self, byte: u8) {
assert!... | 1 | 14 | 14 |
1cc43ff1d6e874c1d12e695f028bfd14b359c8df | tison | 2026-01-04T19:52:25 | doc: fix typo in `SPAN_CIVIL_SECONDS` comment
PR #473 | diff --git a/src/util/t.rs b/src/util/t.rs
index 96a589a..71f8c0c 100644
--- a/src/util/t.rs
+++ b/src/util/t.rs
@@ -278,7 +278,7 @@ pub(crate) type SpanMinutes =
///
/// Note that neither the existence of this constant nor defining our spans
/// based on it impacts the correctness of doing arithmetic on zoned insta... | 1 | 1 | 1 |
6b728036c6f582105c64f44c92f67ec695896542 | tison | 2026-01-04T19:52:00 | impl: avoid superfluous clone of `RelativeZoned`
PR #472 | diff --git a/src/span.rs b/src/span.rs
index 967052a..7489889 100644
--- a/src/span.rs
+++ b/src/span.rs
@@ -6578,8 +6578,7 @@ impl Nudge {
let mut rounded_time_nanos =
mode.round_by_unit_in_nanoseconds(time_nanos, smallest, increment);
let (relative0, relative1) = clamp_relative_span(
- ... | 1 | 1 | 2 |
891380d69d0f528d83dbdc7db1eff4b9c60b0d1c | Andrew Gallant | 2026-01-04T19:26:14 | bench: add benchmark for `time-format`
It's extremely slow:
```
$ critcmp x01 -g '(.*/)(?:jiff|time-format)$' -f print/strftime/oneshot/to_string
group x01/jiff x01/time-format
----- -------- ----... | diff --git a/bench/Cargo.toml b/bench/Cargo.toml
index f18af00..7aac919 100644
--- a/bench/Cargo.toml
+++ b/bench/Cargo.toml
@@ -31,6 +31,8 @@ time = { version = "0.3.36", features = ["formatting", "macros", "parsing"] }
humantime = "2.1.0"
+time-format = "1.2.2"
+
[profile.release]
debug = true
diff --git a/b... | 2 | 22 | 0 |
64dc8daee7765bb69f608f684f56716df04f5c75 | Andrew Gallant | 2026-01-04T17:54:14 | fmt: optimize integer formatting
This gets another small win by optimizing small integer formatting:
```
$ critcmp baseline pr pr2 pr3 -f jiff
group baseline pr pr2 pr3
----- ... | diff --git a/src/fmt/buffer.rs b/src/fmt/buffer.rs
index a24b1e8..b58ecb0 100644
--- a/src/fmt/buffer.rs
+++ b/src/fmt/buffer.rs
@@ -13,6 +13,30 @@ const MAX_PRECISION: usize = 9;
/// This relies on the fact that the maximum padding is clamped to `20`.
const BROAD_MINIMUM_BUFFER_LEN: usize = 20;
+/// All integers i... | 2 | 85 | 21 |
e7cb6473a23cba0c9c4d1bd686af862f67362703 | Andrew Gallant | 2026-01-03T13:43:39 | fmt: further refactor `strftime`
This is another improvement on runtime performance *and* a decrease in
binary size. For binary size, we now get a 27,000 LLVM line improvement
on my synthetic benchmark (up from a 23,000 line improvement in
the previous commit) and a 14,000 LLVM line improvement on my Biff
benchmark (u... | diff --git a/src/fmt/strtime/format.rs b/src/fmt/strtime/format.rs
index 544ae33..5c11f3c 100644
--- a/src/fmt/strtime/format.rs
+++ b/src/fmt/strtime/format.rs
@@ -8,7 +8,7 @@ use crate::{
strtime::{
month_name_abbrev, month_name_full, weekday_name_abbrev,
weekday_name_full, BrokenDo... | 3 | 438 | 337 |
317f81e96cd9b3dcf50063567818243434ee1d87 | Andrew Gallant | 2026-01-03T01:57:48 | fmt: refactor `strftime` to use uninitialized buffers
The code size decrease in my synthetic benchmark is quite substantial:
it reduces LLVM line count by around 23,000 lines. But there's
effectively no change in Biff LLVM lines. Weird. I don't understand it.
Biff does use two different implementations of `Custom`, so... | diff --git a/src/fmt/buffer.rs b/src/fmt/buffer.rs
index a805523..a24b1e8 100644
--- a/src/fmt/buffer.rs
+++ b/src/fmt/buffer.rs
@@ -186,6 +186,22 @@ impl<'data> BorrowedBuffer<'data> {
self.filled += string.len() as u16;
}
+ /// Writes the given Unicode scalar value (as UTF-8) to this writer.
+ /... | 6 | 114 | 476 |
fe9b914277b56c1f1d73ca81bb29794bfba0ac8a | Andrew Gallant | 2026-01-02T23:16:27 | bench: add more strftime benchmarks
We don't really vary up the format string (arguably we should),
but instead add more coverage for other APIs. Current results:
```
$ critcmp baseline -g '(.*/)(?:jiff|time|chrono)$'
group baseline/chrono baseline/jiff ... | diff --git a/bench/src/print.rs b/bench/src/print.rs
index 7d27967..75bc662 100644
--- a/bench/src/print.rs
+++ b/bench/src/print.rs
@@ -823,6 +823,9 @@ fn print_strftime(c: &mut Criterion) {
// `strftime`-style APIs, but I decided to just copy this from the existing
// `strptime` benchmark for now. (Which wa... | 1 | 81 | 4 |
e683626b0e6c8db94379c7edc02652bd1fd058aa | Andrew Gallant | 2026-01-02T21:07:16 | doc: add panic conditions for `Date::at` and `Time::on`
This is just documented existing (and intended) behavior. | diff --git a/src/civil/date.rs b/src/civil/date.rs
index e56f66f..2dc1a73 100644
--- a/src/civil/date.rs
+++ b/src/civil/date.rs
@@ -1307,6 +1307,19 @@ impl Date {
/// A convenience function for constructing a [`DateTime`] from this date
/// at the time given by its components.
///
+ /// # Panics
+ ... | 2 | 28 | 0 |
e28b3a9a5205bda3326498ed5ca4005577a2d8a5 | Andrew Gallant | 2025-12-31T17:29:25 | fmt: get rid of the internal `rfc9557` configuration knob
It was always enabled. I believe I added this when I first wrote
the printer, assuming it would need to be configurable. But it is,
at time of writing, always enabled. So let's just squash it. | diff --git a/src/fmt/temporal/printer.rs b/src/fmt/temporal/printer.rs
index cbf5f40..dd067c5 100644
--- a/src/fmt/temporal/printer.rs
+++ b/src/fmt/temporal/printer.rs
@@ -34,18 +34,12 @@ const MAX_DURATION_LEN: usize = 35;
pub(super) struct DateTimePrinter {
lowercase: bool,
separator: u8,
- rfc9557: bo... | 1 | 5 | 18 |
7e32b136f6ffd7d81ab98f7bd8ff5b2484ca081e | Andrew Gallant | 2025-12-31T16:50:32 | fmt: tweak `BorrowedBuffer::with_writer` API
Previously, we assumed that the size of the stack allocated buffer and
the runtime allocated extra capacity would always be the same. This is
okay for the case where there is very little difference between the
minimum and maximum lengths. But for RFC 9557 zoned datetimes, t... | diff --git a/src/fmt/buffer.rs b/src/fmt/buffer.rs
index 58ac3fe..4ec7f45 100644
--- a/src/fmt/buffer.rs
+++ b/src/fmt/buffer.rs
@@ -84,6 +84,7 @@ impl<'data> BorrowedBuffer<'data> {
#[cfg_attr(feature = "perf-inline", inline(always))]
pub(crate) fn with_writer<const N: usize>(
wtr: &mut dyn Write,
+... | 2 | 5 | 1 |
97b5c17a1d56324216a6f47c960b95bd017bce48 | Andrew Gallant | 2025-12-31T20:29:56 | bench: add RFC 3339 benchmarks for `humantime` | diff --git a/bench/src/print.rs b/bench/src/print.rs
index 744642d..7d27967 100644
--- a/bench/src/print.rs
+++ b/bench/src/print.rs
@@ -1,4 +1,4 @@
-use std::hint::black_box as bb;
+use std::{hint::black_box as bb, time::SystemTime};
use criterion::Criterion;
use jiff::{
@@ -644,6 +644,7 @@ fn print_rfc3339(c: &mu... | 1 | 26 | 1 |
c5ab0780698e205213d142f90f236f49f0a74eca | Andrew Gallant | 2025-12-31T20:23:15 | bench: move RFC 3339 printing benchmarks
Just so that they are in lexicographic order. This doesn't make any
other changes. | diff --git a/bench/src/print.rs b/bench/src/print.rs
index c34c8e0..744642d 100644
--- a/bench/src/print.rs
+++ b/bench/src/print.rs
@@ -549,12 +549,12 @@ fn print_iso8601_duration(c: &mut Criterion) {
}
}
-/// Measures the time it takes to print a `Zoned` in the RFC 3339 format.
-fn print_rfc3339(c: &mut Crite... | 1 | 41 | 41 |
91f5620e4e83fb779009d2977ab2705df0f3baac | Andrew Gallant | 2025-12-31T00:51:11 | fmt: refactor Temporal ISO 8601 duration printer to use uninitialized buffers
In a simple benchmark program that prints spans, signed and unsigned
durations using `jiff::fmt::temporal::SpanPrinter`, the total number of
LLVM lines is reduced by about 6,000.
There is also a modest improvement in runtime performance:
`... | diff --git a/src/fmt/temporal/printer.rs b/src/fmt/temporal/printer.rs
index 484bbfe..cbf5f40 100644
--- a/src/fmt/temporal/printer.rs
+++ b/src/fmt/temporal/printer.rs
@@ -1,20 +1,35 @@
+use core::time::Duration;
+
use crate::{
civil::{Date, DateTime, ISOWeekDate, Time},
error::{fmt::temporal::Error as E, E... | 3 | 207 | 212 |
5f171b5c2005602f5c96f4f00218d791ccf3e589 | Andrew Gallant | 2025-12-30T23:47:35 | span: replace some code with `SignedDuration` constructor
This also reduces code size slightly. | diff --git a/src/span.rs b/src/span.rs
index 57886ed..aa05d7f 100644
--- a/src/span.rs
+++ b/src/span.rs
@@ -2453,19 +2453,9 @@ impl Span {
self.largest_unit() <= Unit::Week,
"units must be weeks or lower"
);
-
- let seconds = nanos / t::NANOS_PER_SECOND;
- let seconds =... | 1 | 3 | 13 |
9b305467926bdf87a4918353a016d2b8270f3afc | tison | 2025-12-30T15:32:04 | sqlx: use `Timestamp::constant` for `POSTGRES_EPOCH_TIMESTAMP`
I think this code was written before `Timestamp::constant`
was added.
PR #466 | diff --git a/crates/jiff-sqlx/src/postgres.rs b/crates/jiff-sqlx/src/postgres.rs
index 9d00a61..9557b7f 100644
--- a/crates/jiff-sqlx/src/postgres.rs
+++ b/crates/jiff-sqlx/src/postgres.rs
@@ -22,7 +22,8 @@ use crate::{Date, DateTime, Span, Time, Timestamp, ToSqlx};
static POSTGRES_EPOCH_DATE: civil::Date = civil::dat... | 1 | 3 | 6 |
1a71c3041919ae7e2e7030c73c32f4ea38c0b590 | Andrew Gallant | 2025-12-29T18:13:26 | fmt: refactor friendly printer to use padding/precision more explicitly
Basically, instead of creating and passing around an `IntegerFormatter`
or `FractionalFormatter`, we pass around padding and precision options
explicitly. We then materialize the formatters as needed. While this
looks odd, this is meant to prepare... | diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs
index 1a70f14..a4f5084 100644
--- a/src/fmt/friendly/printer.rs
+++ b/src/fmt/friendly/printer.rs
@@ -1316,18 +1316,22 @@ impl SpanPrinter {
}
}
- let fmtint =
- IntegerFormatter::new().padding(self.padding.... | 1 | 78 | 44 |
83e2f24213413035b2c552a2a972e2a0ce83f55a | Andrew Gallant | 2025-12-29T17:55:48 | fmt: small change to unexport `Fractional::new`
I just find this makes it easier to see all of the entry points into the
existing fractional formatter. | diff --git a/src/fmt/mod.rs b/src/fmt/mod.rs
index 3097f65..5721462 100644
--- a/src/fmt/mod.rs
+++ b/src/fmt/mod.rs
@@ -507,7 +507,7 @@ trait WriteExt: Write {
formatter: &FractionalFormatter,
n: impl Into<u32>,
) -> Result<(), Error> {
- self.write_fractional(&Fractional::new(formatter, ... | 2 | 2 | 2 |
ff875c35120748f2101fc5d2bf134da2fe7bbf16 | Andrew Gallant | 2025-12-29T16:39:26 | fmt: add more formatting routines to `BorrowedBuffer`
We'll need these to port more of Jiff's printers to the uninitialized
buffer abstraction.
I'm somewhat unhappy with the extra code here, but all of these routines
are intended to be inlined anyway. So this might end up saving code in
the long run.
I'm also somewh... | diff --git a/src/fmt/buffer.rs b/src/fmt/buffer.rs
index 1b2e220..ad5bde5 100644
--- a/src/fmt/buffer.rs
+++ b/src/fmt/buffer.rs
@@ -3,10 +3,14 @@ use core::mem::MaybeUninit;
use crate::{fmt::Write, Error};
const MAX_CAPACITY: usize = u8::MAX as usize;
+// From `u64::MAX.to_string().len()`.
+const MAX_INTEGER_LEN: ... | 2 | 572 | 2 |
811802ca462651a49982f0c21a26124c770e773a | Andrew Gallant | 2025-12-28T20:55:26 | fmt: small tweak to friendly printer
This reduces LLVM lines in my benchmark by a couple hundred lines. | diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs
index db866a3..1a70f14 100644
--- a/src/fmt/friendly/printer.rs
+++ b/src/fmt/friendly/printer.rs
@@ -1295,15 +1295,17 @@ impl SpanPrinter {
span: &Span,
mut wtr: W,
) -> Result<(), Error> {
- let span_cal = span.only_c... | 1 | 10 | 9 |
db9ba05f6c05905b0c20d4bd72e8f634bda842b1 | Andrew Gallant | 2025-12-28T13:40:41 | fmt: clarify maximum padding/precision values
There's no behavior changes here, but the maximums weren't
previously documented. | diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs
index c2a9a07..db866a3 100644
--- a/src/fmt/friendly/printer.rs
+++ b/src/fmt/friendly/printer.rs
@@ -821,6 +821,9 @@ impl SpanPrinter {
/// of `2` is used for units of hours, minutes and seconds. Otherwise, a
/// padding of `0` is used.
... | 2 | 7 | 1 |
57eed5e1f130381c492a4961c0c44220ff4654e1 | Andrew Gallant | 2025-12-28T01:28:42 | bench: add more print benchmarks | diff --git a/bench/src/convert.rs b/bench/src/convert.rs
index 7755ed5..26d69c8 100644
--- a/bench/src/convert.rs
+++ b/bench/src/convert.rs
@@ -95,6 +95,13 @@ impl ConvertFrom<jiff::civil::Time> for chrono::NaiveTime {
}
}
+impl ConvertFrom<jiff::SignedDuration> for chrono::TimeDelta {
+ fn convert_from(x: ... | 2 | 644 | 46 |
8849db3790c093f1328978d283763e213e072a7f | Andrew Gallant | 2025-12-28T00:44:08 | fmt: forcefully elide more bounds checks
We're already using `unsafe` here, so we might as well go whole hog and
eliminate as much code as possible. | diff --git a/src/fmt/buffer.rs b/src/fmt/buffer.rs
index 0daae12..1b2e220 100644
--- a/src/fmt/buffer.rs
+++ b/src/fmt/buffer.rs
@@ -217,15 +217,19 @@ impl<'data> BorrowedBuffer<'data> {
// a pain.
let digits = if n == 0 { 1 } else { n.ilog10() as u8 + 1 };
let available = self.available();
+... | 1 | 36 | 10 |
e41ded34f8d35af387258a56471c1d3da0189619 | Andrew Gallant | 2025-12-29T13:26:46 | error: replace a few more instances of unnecessary `write!` calls
I missed these because I had filtered `src/error/` out of my search for
`write!` calls when looking for ones that could be removed. (Because
`src/error/` is where `write!` is most commonly needed.) | diff --git a/src/error/mod.rs b/src/error/mod.rs
index 47094da..9a21171 100644
--- a/src/error/mod.rs
+++ b/src/error/mod.rs
@@ -725,11 +725,11 @@ impl core::fmt::Display for IOError {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
#[cfg(feature = "std")]
{
- write!... | 1 | 6 | 6 |
8f6a73fd32c8cd6b6b30414ae1c6a7c791204d40 | Andrew Gallant | 2025-12-28T13:17:35 | signed_duration: update docs
This is a bit of a follow-up to #462. | diff --git a/src/signed_duration.rs b/src/signed_duration.rs
index 04edc9b..ad43610 100644
--- a/src/signed_duration.rs
+++ b/src/signed_duration.rs
@@ -150,13 +150,17 @@ const MINS_PER_HOUR: i64 = 60;
/// duration, like [`SignedDuration::abs`] and [`SignedDuration::checked_neg`].
/// * A [`SignedDuration::system_unt... | 1 | 6 | 2 |
25c9b335f70cd424f46d0eb357fad30d76f16943 | Andrew Gallant | 2025-12-26T01:54:25 | error: squash warning on older versions of Rust
Kind of interesting that this doesn't appear on newer
versions of Rust. I think it's technically correct? | diff --git a/src/error/mod.rs b/src/error/mod.rs
index c320a6d..47094da 100644
--- a/src/error/mod.rs
+++ b/src/error/mod.rs
@@ -696,8 +696,10 @@ impl core::fmt::Display for CrateFeatureError {
TzdbZoneInfo => "tzdb-zoneinfo",
};
#[allow(unreachable_code)]
- core::fmt::Display::fmt... | 1 | 4 | 2 |
2ed0e460a122912108eab42cb2a1e532ae703e4c | Andrew Gallant | 2025-12-25T23:59:09 | fmt: add support for a `&mut Vec<u8>` fast path
The printers can use this method to write directly into the
`Vec<u8>`'s spare capacity, instead of needing to write to our
new uninitialized buffer and then copy the data via the
`jiff::fmt::Write` interface.
Using the uninitialized buffer without this is still a dramat... | diff --git a/src/fmt/mod.rs b/src/fmt/mod.rs
index 1226ddf..3097f65 100644
--- a/src/fmt/mod.rs
+++ b/src/fmt/mod.rs
@@ -277,8 +277,9 @@ impl<'i, V: core::fmt::Debug> core::fmt::Debug for Parsed<'i, V> {
/// The `std::fmt::Write` trait wasn't used itself because:
///
/// 1. Using a custom trait allows us to require ... | 1 | 49 | 2 |
dca73c5a5d20318ea186969ca357e1d051d61dcc | Andrew Gallant | 2025-12-23T02:47:11 | bench: add RFC 2822 printing benchmark
We're going to be doing some surgery on the RFC 2822 printer. Mostly
motivated by decreasing binary size. But we should be able to optimize
runtime as well.
The printer is actually already pretty slow compared to `time`:
```
$ critcmp base -g '(.*)/(?:humantime|jiff|chrono|time... | diff --git a/bench/src/print.rs b/bench/src/print.rs
index db757c7..121b2cf 100644
--- a/bench/src/print.rs
+++ b/bench/src/print.rs
@@ -1,13 +1,18 @@
use std::hint::black_box as bb;
use criterion::Criterion;
-use jiff::civil;
+use jiff::{
+ civil,
+ tz::{Offset, TimeZone},
+ Timestamp,
+};
use crate::{... | 1 | 96 | 1 |
65825cf1a34f603bbbdf4db20f9a513d0376f45e | Andrew Gallant | 2025-12-24T19:32:23 | fuzz: update dependencies | diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock
index 5e5046c..8f2fadd 100644
--- a/fuzz/Cargo.lock
+++ b/fuzz/Cargo.lock
@@ -13,9 +13,9 @@ dependencies = [
[[package]]
name = "cc"
-version = "1.2.49"
+version = "1.2.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90583009037521a11... | 1 | 6 | 6 |
edb7cd21422ae6b9131c447eb8685d77c55968ff | Andrew Gallant | 2025-12-24T17:09:08 | deps: bump jiff-tzdb to 0.1.5
This includes an updated to the tzdb 2025c release. | diff --git a/Cargo.toml b/Cargo.toml
index 57a0974..ae48911 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -179,7 +179,7 @@ perf-inline = []
[dependencies]
jiff-static = { version = "0.2", path = "crates/jiff-static", optional = true }
-jiff-tzdb = { version = "0.1.4", path = "crates/jiff-tzdb", optional = true }
+jif... | 1 | 1 | 1 |
61dc9bd8aa1cec759a35983e2f5984f47e5d8bf7 | Andrew Gallant | 2025-12-23T01:46:31 | fmt: rename `Decimal` to `Integer`
And similarly for `DecimalFormatter`.
I believe I originally called this `Decimal` because it was also used to
do fractional formatting. | diff --git a/src/fmt/friendly/printer.rs b/src/fmt/friendly/printer.rs
index f61bf4c..c2a9a07 100644
--- a/src/fmt/friendly/printer.rs
+++ b/src/fmt/friendly/printer.rs
@@ -1,6 +1,6 @@
use crate::{
fmt::{
- util::{DecimalFormatter, FractionalFormatter},
+ util::{FractionalFormatter, IntegerFormatter... | 6 | 99 | 99 |
1467f47e36ea69c6db079df4e7233943225a348d | Andrew Gallant | 2025-12-23T01:44:21 | fmt: get rid of `Decimal::end`
It's not used. I believe it was being used when `Decimal` was also
responsible for formatting the fractional part of a floating point
number. But it isn't needed any more. | diff --git a/src/fmt/util.rs b/src/fmt/util.rs
index fc0ddbf..a51e39e 100644
--- a/src/fmt/util.rs
+++ b/src/fmt/util.rs
@@ -83,7 +83,6 @@ impl Default for DecimalFormatter {
pub(crate) struct Decimal {
buf: [u8; Self::MAX_LEN as usize],
start: u8,
- end: u8,
}
impl Decimal {
@@ -98,11 +97,8 @@ impl D... | 1 | 4 | 8 |
5b27b22096a39e1b022ef362c17b777f41688600 | Andrew Gallant | 2025-12-23T01:02:11 | fmt: simplify decimal formatter
I don't think we need to keep track of maximum digits separately for
signed and unsigned integer formatting. I think this might mean that
signed integer formatting uses an extra byte of stack space, but, it can
also have a sign. Unlike unsigned integer formatting. So no space is
wasted ... | diff --git a/src/fmt/util.rs b/src/fmt/util.rs
index fe214de..fc0ddbf 100644
--- a/src/fmt/util.rs
+++ b/src/fmt/util.rs
@@ -14,11 +14,9 @@ use crate::{
/// faster. We roll our own which is a bit slower, but gets us enough of a win
/// to be satisfied with and with (almost) pure safe code.
///
-/// By default, this ... | 1 | 16 | 114 |
4d2041567c2b98f9105444cd8e16f9cb616271b6 | Andrew Gallant | 2025-12-22T19:54:35 | binary-size: remove many uses of `write!`
Using `write!` unnecessarily when a simple `f.write_str` would do ends
up generating more LLVM lines on my Biff `cargo llvm-lines` benchmark.
This PR replaces those uses of `write!` with `Formatter::write_str`. | diff --git a/crates/jiff-static/src/shared/posix.rs b/crates/jiff-static/src/shared/posix.rs
index eb6b29e..6297171 100644
--- a/crates/jiff-static/src/shared/posix.rs
+++ b/crates/jiff-static/src/shared/posix.rs
@@ -1673,8 +1673,7 @@ impl core::fmt::Display for PosixJulianNoLeapError {
f.write_str("in... | 14 | 79 | 97 |
21f69521cdeba481b66ee8bf24bd065967363b04 | Andrew Gallant | 2025-12-22T19:15:40 | shared: remove escaping and UTF-8 routines from `shared` module
With the error refactor, these are no longer used. Namely, while
switching to structured errors, I took that opportunity to slim down
errors so that we are not repeating parts of the input as often. | diff --git a/crates/jiff-static/src/shared/util/escape.rs b/crates/jiff-static/src/shared/util/escape.rs
index 5e3b8b3..e5b182b 100644
--- a/crates/jiff-static/src/shared/util/escape.rs
+++ b/crates/jiff-static/src/shared/util/escape.rs
@@ -122,3 +122,4 @@ impl core::fmt::Debug for RepeatByte {
Ok(())
}
... | 10 | 210 | 222 |
a50f6797ce06f78e1071acb653c4abc0f024b2c7 | Andrew Gallant | 2025-12-22T14:48:24 | logging: small tweak to formatting | diff --git a/src/tz/db/bundled/enabled.rs b/src/tz/db/bundled/enabled.rs
index 7592ea2..434b3a0 100644
--- a/src/tz/db/bundled/enabled.rs
+++ b/src/tz/db/bundled/enabled.rs
@@ -26,8 +26,8 @@ impl Database {
Err(_err) => {
warn!(
"failed to parse TZif data from bundled ... | 1 | 2 | 2 |
523b55bc1a12d8c71fae36f50a644c7570c50133 | Andrew Gallant | 2025-12-22T14:40:20 | error: add `Error::is_invalid_parameter` predicate | diff --git a/src/error/mod.rs b/src/error/mod.rs
index 52edc89..461be2b 100644
--- a/src/error/mod.rs
+++ b/src/error/mod.rs
@@ -111,6 +111,80 @@ impl Error {
matches!(*self.root().kind(), Range(_) | SlimRange(_) | ITimeRange(_))
}
+ /// Returns true when this error originated as a result of an inval... | 1 | 74 | 0 |
3cb0b6aefa01f58498ab22fa18f8e0e1fe357697 | Andrew Gallant | 2025-12-21T15:34:57 | error: add `Error::is_crate_feature` predicate
There's only a few of these, but they seem like a distinct category
from other error types. It's also nice to do this and standarize on the
specific error message.
The other reason I wanted to do this was to distinguish it from a
possible "is configuration error" categor... | diff --git a/src/error/mod.rs b/src/error/mod.rs
index 14ae0c1..52edc89 100644
--- a/src/error/mod.rs
+++ b/src/error/mod.rs
@@ -110,6 +110,21 @@ impl Error {
use self::ErrorKind::*;
matches!(*self.root().kind(), Range(_) | SlimRange(_) | ITimeRange(_))
}
+
+ /// Returns true when this error o... | 6 | 88 | 23 |
8e8033a29d6e7178167207e5604f632dd20e95a3 | Andrew Gallant | 2025-12-21T14:09:15 | error: add `Error::is_range` predicate
I'm somewhat concerned that this doesn't cover all cases, but I think
this should be a good start. | diff --git a/src/civil/date.rs b/src/civil/date.rs
index 5d53c6c..e56f66f 100644
--- a/src/civil/date.rs
+++ b/src/civil/date.rs
@@ -1059,7 +1059,7 @@ impl Date {
let nth = t::SpanWeeks::try_new("nth weekday", nth)?;
if nth == C(0) {
- Err(Error::from(E::NthWeekdayNonZero))
+ E... | 3 | 25 | 3 |
259e8134ef07540beec9d1ed507b9a7a95aa9ba2 | Andrew Gallant | 2025-12-21T13:13:11 | error: implement an error chaining iterator
We previously only used this in the `core::fmt::Display` trait
implementation, so we just inlined it there. But we'll want to use it to
get the root of the chain for error predicates, so this commit does some
refactoring to provide a standalone internal iterator for the erro... | diff --git a/crates/jiff-static/src/shared/tzif.rs b/crates/jiff-static/src/shared/tzif.rs
index 6406578..1b60a78 100644
--- a/crates/jiff-static/src/shared/tzif.rs
+++ b/crates/jiff-static/src/shared/tzif.rs
@@ -503,7 +503,6 @@ impl TzifOwned {
/// and the timestamps in TZif data are, of course, all in UTC.)
... | 4 | 88 | 60 |
831d3efb4da42bc70f7ac0294bc68a5c077bcf3d | Andrew Gallant | 2025-12-20T18:35:20 | shared: move itime range error into itime module
This follows the pattern I used for TZif and POSIX time zone parsing. | diff --git a/crates/jiff-static/src/shared/mod.rs b/crates/jiff-static/src/shared/mod.rs
index cfb528f..067be4b 100644
--- a/crates/jiff-static/src/shared/mod.rs
+++ b/crates/jiff-static/src/shared/mod.rs
@@ -474,7 +474,6 @@ pub struct PosixOffset {
// Does not require `alloc`, but is only used when `alloc` is enabl... | 9 | 258 | 221 |
ac0054c72f72f4ea131128200d543b0c99337e68 | Andrew Gallant | 2025-12-20T01:36:03 | shared: replace some uses of `write!`
I believe this reduces code size. | diff --git a/src/shared/posix.rs b/src/shared/posix.rs
index c9a4014..648ad39 100644
--- a/src/shared/posix.rs
+++ b/src/shared/posix.rs
@@ -342,12 +342,11 @@ impl<ABBREV: AsRef<str> + Debug> PosixTimeZone<ABBREV> {
impl<ABBREV: AsRef<str>> core::fmt::Display for PosixTimeZone<ABBREV> {
fn fmt(&self, f: &mut co... | 1 | 37 | 19 |
f2751642392ec2044754e2a122b8e23a5902b7d2 | Andrew Gallant | 2025-12-20T01:24:08 | shared: remove `alloc` cfgs
I guess parsing a POSIX time zone doesn't actually require `alloc` any
more. That's cool. | diff --git a/crates/jiff-static/src/shared/posix.rs b/crates/jiff-static/src/shared/posix.rs
index fef2428..1296adf 100644
--- a/crates/jiff-static/src/shared/posix.rs
+++ b/crates/jiff-static/src/shared/posix.rs
@@ -1577,10 +1577,8 @@ impl<'s> Parser<'s> {
}
}
-// Tests require parsing, and parsing requires al... | 4 | 625 | 255 |
d024322b2728181502d8c1812156348562a0fd9b | Andrew Gallant | 2025-12-20T00:20:40 | shared: use structured errors for TZif parsing
For this one, I defined the error type inline with it. This just felt
right and it does stay reasonably encapsulated.
I'll probably swing back and do the same for the time range error type? | diff --git a/src/error/mod.rs b/src/error/mod.rs
index 1d81b23..85a158a 100644
--- a/src/error/mod.rs
+++ b/src/error/mod.rs
@@ -161,6 +161,11 @@ impl Error {
Error::from(ErrorKind::Shared2(err))
}
+ /// Creates a new error from the special TZif error type.
+ pub(crate) fn tzif(err: crate::shared:... | 3 | 592 | 220 |
973876a9f1188f7026ed40dc330bc97b03b6245d | Andrew Gallant | 2025-12-19T20:55:39 | shared: use structured errors for `shared/itime` | diff --git a/crates/jiff-cli/cmd/generate/shared.rs b/crates/jiff-cli/cmd/generate/shared.rs
index be1783e..580d89a 100644
--- a/crates/jiff-cli/cmd/generate/shared.rs
+++ b/crates/jiff-cli/cmd/generate/shared.rs
@@ -79,7 +79,7 @@ fn copy(srcdir: &Path, dstdir: &Path, dir: &Path) -> anyhow::Result<()> {
fn copy_rust_s... | 13 | 394 | 175 |
3a832162bed7f1e170ac92e7770908db9d51a4f1 | Andrew Gallant | 2025-12-19T18:11:17 | fmt: some minor perf improvements to `strptime`
This adds a little inlining back to help reclaim a small performance
regression in `strptime`. This improves the relevant benchmark from
70ns to 64ns on my machine. | diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs
index 8c1915e..84e1c1c 100644
--- a/src/fmt/strtime/mod.rs
+++ b/src/fmt/strtime/mod.rs
@@ -1571,18 +1571,20 @@ impl BrokenDownTime {
/// ```
#[inline]
pub fn to_timestamp(&self) -> Result<Timestamp, Error> {
- #[cold]
- #[inline(... | 1 | 30 | 14 |
3765a52b8d1e45a3cee182babc32785d4ed9d39c | Andrew Gallant | 2025-11-16T18:41:20 | fmt: add `&mut dyn Write` impl for `jiff::fmt::Write`
I was playing with using this to avoid parametric polymorphism
costs, but I couldn't find my way to a concrete benefit.
Either way, this impl should exist for people that want to
use it. | diff --git a/src/fmt/mod.rs b/src/fmt/mod.rs
index b5886fa..e7d22b4 100644
--- a/src/fmt/mod.rs
+++ b/src/fmt/mod.rs
@@ -334,6 +334,17 @@ impl<W: Write> Write for &mut W {
}
}
+impl Write for &mut dyn Write {
+ fn write_str(&mut self, string: &str) -> Result<(), Error> {
+ (**self).write_str(string)
+... | 1 | 11 | 0 |
42080c4e71fa25a16a64c5ec460f86ff777922d6 | Andrew Gallant | 2025-11-16T18:40:22 | fmt/strtime: avoid inlining the `or_else` cases
These all generally call `BrokenDownTime::to_date`, which
adds a fair bit of code. Since these are the uncommon case,
let's not inline that goop. | diff --git a/src/fmt/strtime/format.rs b/src/fmt/strtime/format.rs
index 5d5d9a5..e5e8064 100644
--- a/src/fmt/strtime/format.rs
+++ b/src/fmt/strtime/format.rs
@@ -339,7 +339,10 @@ impl<'c, 'f, 't, 'w, W: Write, L: Custom> Formatter<'c, 'f, 't, 'w, W, L> {
let day = self
.tm
.day
- ... | 1 | 99 | 27 |
40941a5188302db120a9b914e9ae73e6121efa2a | Andrew Gallant | 2025-11-16T18:39:33 | fmt/strtime: tighten up `to_timestamp` and `to_date`
Both of these functions are marked as `inline`, but they can
be quite beefy. Instead, set the inlineable implementation
as the common case, and put the rest behind a non-inlineable
function. | diff --git a/src/fmt/strtime/mod.rs b/src/fmt/strtime/mod.rs
index 9455dd0..32d3fda 100644
--- a/src/fmt/strtime/mod.rs
+++ b/src/fmt/strtime/mod.rs
@@ -1584,21 +1584,27 @@ impl BrokenDownTime {
/// ```
#[inline]
pub fn to_timestamp(&self) -> Result<Timestamp, Error> {
+ #[cold]
+ #[inline(... | 1 | 67 | 46 |
37803515434b2ad5f1e3c78163601d44a420949d | Andrew Gallant | 2025-11-16T18:38:10 | rangeint: don't try to inline error constructor | diff --git a/src/util/rangeint.rs b/src/util/rangeint.rs
index a20ec34..c1a811c 100644
--- a/src/util/rangeint.rs
+++ b/src/util/rangeint.rs
@@ -379,7 +379,7 @@ macro_rules! define_ranged {
/// dependent bounds. For example, when the day of the month is out
/// of bounds. The maximum value can... | 1 | 1 | 1 |
54c1b2d25b8b35929140b3d929f85bc26fa72429 | Andrew Gallant | 2025-11-14T21:28:06 | error: make `map_err` closures as `cold` and non-inlineable
This doesn't seem to have much impact as shown via a
`cargo llvm-lines`. But this still seems like good sense
to have. | diff --git a/src/error.rs b/src/error.rs
index 0675547..66e9497 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -647,7 +647,11 @@ impl ErrorContext for Error {
impl<T> ErrorContext for Result<T, Error> {
#[cfg_attr(feature = "perf-inline", inline(always))]
fn context(self, consequent: impl IntoError) -> Resu... | 1 | 10 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.