fix(deps): remove embedded-time, define internal Clock/Instant/Millis types#4
Merged
smartyalgo merged 3 commits intomainfrom Apr 8, 2026
Merged
fix(deps): remove embedded-time, define internal Clock/Instant/Millis types#4smartyalgo merged 3 commits intomainfrom
smartyalgo merged 3 commits intomainfrom
Conversation
… types
- Remove embedded-time 0.12 from toad and toad-jni
- Introduce crate::time::{Clock, Instant, Millis, Milliseconds, ClockError} replacing embedded-time's equivalents
- Update all callsites: Stamped<C,T>→Stamped<T>, RetryTimer/State no longer Clock-generic, prune/seen/debug fns use plain Instant
- std::Clock now returns elapsed.as_millis() as u64; ClockMock stores micros and divides by 1000
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- time.rs: replace Millis(...) type alias constructors with Milliseconds(...) - time.rs: add Display impl for Milliseconds<T> - time.rs: export Clock trait in doctest - step/mod.rs: fix Stamped<Clock<P>,T> -> Stamped<T> (1 type param) - step/provision_ids.rs: fix Stamped<ClockMock,T> -> Stamped<T> in tests - step/provision_ids.rs: remove obsolete embedded-time Microseconds assertion - step/provision_ids.rs: use 1000x timestamps for distinct millisecond values - step/observe.rs, parse.rs, mod.rs: replace ClockMock::new().try_now().unwrap() with ClockMock::instant(0) (Clock trait not in scope in test modules) - test.rs: allow(missing_docs) for test module - step/mod.rs: allow(missing_docs) for pub test module - toad-jni/Cargo.toml: use local path dep instead of published toad 0.19.1 - toad/Cargo.toml: bump simple_logger 2->5 to fix time 0.3 compile error - retry.rs doctest: import Clock trait for try_now() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5b35a03 to
c08359b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
embedded-time 0.12has been unmaintained since 2021 and is incompatible with current ecosystem crates. This PR removes it from bothtoadandtoad-jniand replaces its usage with lightweight internal types.New types in
toad::timeClocktrait (try_now() -> Result<Instant, ClockError>)embedded_time::ClockInstant(u64)— millis since epochembedded_time::Instant<C>Millis/Milliseconds<T>embedded_time::duration::MillisecondsClockErrorembedded_time::clock::ErrorKey callsite changes
Stamped<C, T>→Stamped<T>— clock type param was only used for construction, now taken as&impl ClockRetryTimer<C>/State<C>instep/retry.rs— clock type param removed entirelyprune()/seen()instep/provision_ids.rs—Instant<P::Clock>→Instant; replacedchecked_duration_since(embedded-time API) with saturating subtractionstd::Clock—elapsed.as_millis() as u64instead ofFraction-based conversiontest::ClockMock— stores raw microseconds,try_now()divides by 1000 to return millisecondsFiles changed
toad/Cargo.toml,toad-jni/Cargo.toml— removeembedded-timetoad/src/time.rs— rewritten with internal typestoad/src/platform.rs,toad/src/retry.rs,toad/src/std/mod.rs,toad/src/test.rstoad/src/step/retry.rs,provision_ids.rs,provision_tokens.rs,observe.rs,parse.rs,mod.rstoad-jni/src/java/io/io_exception.rsTest plan
cargo test -p toad -p toad-jni—toad: 70 tests pass;toad-jni: fails locally due to x86_64 JVM on arm64 Mac (pre-existing env issue, unrelated to this PR; CI passes on Linux)cargo build -p toad -p toad-jni🤖 Generated with Claude Code