mirror of
https://github.com/BurntSushi/jiff.git
synced 2025-12-23 08:47:45 +00:00
I'm not sure when or how exactly it happened, but in the last weeks, I've noticed that `rustc` gets effectively stun-locked whenever I make a change to a source file in Jiff. A quick examination of what the fuck my computer is doing seems to reveal that it's spending oodles of time compiling diesel over and over. I have no idea why this is happening and I don't really care to spend the time unraveling the mysteries of diesel. So I took a hammer to the problem. I have effectively shunted all examples and all "integration" crates out of Jiff's core workspace and into their own little bloated fiefdoms. To compensate for the fact that `cargo test --all` no longer tests these things, I've added shell scripts to run the requisite tests. And those shell scripts are now run in CI. I'm now back to a state where I can save a file in Jiff and I get sub-second `cargo check` response times. |
||
|---|---|---|
| .. | ||
| Cargo.toml | ||
| main.rs | ||
| README.md | ||
This example shows how to parse the output of uptime on Unix and determine
when the system booted. This demonstrates regex parsing, fallible construction
of spans, zone aware arithmetic and rounding.
To run this program, use:
$ uptime | cargo run -qp uptime
2024-06-28T08:08:00-04:00[America/New_York]
If you don't have uptime, then you can pipe in data that looks like it came
from uptime:
$ echo '14:00:47 up 12 days, 5:53' | cargo run -qp uptime
2024-06-28T08:08:00-04:00[America/New_York]