to construct a static `TimeZone`. The proc macros in `jiff-static` generate code using these types (and a few routines). Secondly, it provides a way to parse TZif data without `jiff-static` depending on `jiff` via a Cargo dependency. This actually requires copying the code in this module (which is why it is kinda sectioned off from the rest of jiff) into the `jiff-static` crate. This can be done automatically with `jiff-cli`: ```text jiff-cli generate shared ``` The copying of code is pretty unfortunate, because it means both crates have to compile it. However, the alternatives aren't great either. One alternative is to have `jiff-static` explicitly depend on `jiff` in its `Cargo.toml`. Then Jiff could expose the parsing routines, as it does here, and `jiff-static` could use them directly. Unfortunately, this means that `jiff` cannot depend on `jiff-static`. And that in turn means that `jiff` cannot re-export the macros. Users will need to explicitly depend on and use `jiff-static`. Moreover, this could result in some potential surprises since `jiff-static` will need to have an `=x.y.z` dependency on Jiff for compatibility reasons. That in turn means that the version of Jiff actually used is not determine by the user's `jiff = "x.y.z"` line, but rather by the user's `jiff-static = "x'.y'.z'"` line. This is overall annoying and not a good user experience. Plus, it inverts the typical relationship between crates and their proc macros (e.g., `serde` and `serde_derive`) and thus could result in other unanticipated surprises. Another obvious alternative is to split this code out into a separate crate that both `jiff` and `jiff-static` depend on. However, the API exposed in this module does not provide a coherent user experience. It would either need a ton of work to turn it into a coherent user experience or it would need to be published as a `jiff-internal-use-only` crate that I find to be very annoying and confusing. Moreover, a separate crate introduces a new semver boundary beneath Jiff. I've found these sorts of things to overall increase maintenance burden (see ripgrep and regex for cases where I did this). I overall decided that the least bad choice was to copy a little code (under 2,000 source lines of code at present I believe). Since the copy is managed automatically via `jiff-cli generate shared`, we remove the downside of the code getting out of sync. The only downside is extra compile time. Since I generally only expect `jiff-static` to be used in niche circumstances, I prefer this trade-off over the other choices. More context on how I arrived at this design can be found here: # Particulars When this code is copied to `jiff-static`, the following transformations are done: * A header is added to indicate that the copied file is auto-generated. * All `#[cfg(feature = "alloc")]` annotations are removed. The `jiff-static` proc macro always runs in a context where the standard library is available. * Any code between `// only-jiff-start` and `// only-jiff-end` comments is removed. Nesting isn't supported. Otherwise, this module is specifically organized in a way that doesn't rely on any other part of Jiff. The one exception are routines to convert from these exposed types to other internal types inside of Jiff. This is necessary for building a static `TimeZone`. But these conversion routines are removed when this module is copied to `jiff-static`.