-
Notifications
You must be signed in to change notification settings - Fork 86
Comparing changes
Open a pull request
base repository: zslayton/cron
base: v0.12.1
head repository: zslayton/cron
compare: v0.15.0
- 14 commits
- 18 files changed
- 11 contributors
Commits on Oct 28, 2024
-
feat: implement efficient conversion from String (#128)
Previous to this changeset, the implementation of `FromStr for Schedule` allocated internally. The same was true for `TryFrom<&str> for Schedule`, which forwarded to the former. Library users had no way to prevent the unnecessary double allocation where a heap-allocated `String` representation is already available, whose ownership could be passed into the `Schedule`. This changeset implements efficient conversion from `Cow<'_, str>`, `String` and `&str`. Borrowed expressions are only heap-allocated if parsing succeeds. Ownership of owned expressions is passed into the `Schedule`, circumventing the previous double allocation. Implements #127
Configuration menu - View commit details
-
Copy full SHA for ef8e33a - Browse repository at this point
Copy the full SHA ef8e33aView commit details -
Run
cargo fmt
and fix allclippy
reports (#123)* chore: Run `cargo fmt` on codebase * chore: Address all reports from `clippy` Mostly reports from deprecated `ymd` both for timezone and `Naive` dates.
Configuration menu - View commit details
-
Copy full SHA for c491880 - Browse repository at this point
Copy the full SHA c491880View commit details -
Fix backwards iteration when inital time has milliseconds (#112)
Iterating back from a date that is later than a candidate by less than 1s but more than 0s should return said candidate. Ex. Let's say the schedule is `0 * * * * *`. - Iterating the schedule before `12:00:05.000` should yield `12:00:04.000` - However, iterating the schedule before `12:00:05.100` (note the milliseconds) should start at `12:00:05.000`. This commit fixes the second case which was yielding `12:00:04.000`.
Configuration menu - View commit details
-
Copy full SHA for e2fb958 - Browse repository at this point
Copy the full SHA e2fb958View commit details -
Patterns with future years should not limit the day and month range (#…
…116) * Patterns with future years should not limit the day and month range * Test does not depend on Utc::now()
Configuration menu - View commit details
-
Copy full SHA for bc07787 - Browse repository at this point
Copy the full SHA bc07787View commit details
Commits on Oct 29, 2024
-
feat: implement optimized
Serialize
andDeserialize
forSchedule
(#129) * Add Serde compatiblity for type Schedule * fix: impl Deserialize behind feature gate * feat: implement optimized `Serialize` and `Deserialize` for `Schedule` Serialization: Serialization uses a direct reference into the `Schedule::source`. Previously, the blanket implementation of `ToString::to_string` had been used, which unnecessarily allocated a string and leveraged `format!` machinery. Deserialization: Deserialization suggests the `Deserializer` to provide an owned `String` to the visitor, as the `Schedule` will take ownership of the `String` after successful decoding. `Deserializer`s not incapable of providing owned `String`s may pass a `&str`, which is decoded, then cloned into an owned `String` for storage in `Schedule::source`. Public API changes: Beside implementing `Serialize` and `Deserialize` behind the `"serde"` feature flag, this changeset also adds a new public method `Schedule::source(&self) -> &str`. This new public method is generally useful and therefore not guarded by the `"serde"` feature flag. * feat(ci): run tests for default features and all features separately * style: normalize serde tests - normalize test names, indicating token verification - [lowercase][C-GOOD-ERR] failure messages [C-GOOD-ERR]: https://rust-lang.github.io/api-guidelines/interoperability.html?highlight=lowercase#error-types-are-meaningful-and-well-behaved-c-good-err * test: e2e test deserialized schedules with binary format This changeset implements serde serialization and deserialization tests beyond the token representation tests provided by `serde_test`. Schedules are serialized to a binary format ([`postcard`][postcard]), then deserialized and used to yield events following a given date and time. These events are compared to a limited set of restricted upcoming events. The tests cover shorthand as well as ranged period cron schedule notation. [postcard]: https://docs.rs/postcard/ --------- Co-authored-by: Max Huster <maxekinge@googlemail.com>
Configuration menu - View commit details
-
Copy full SHA for c5d5589 - Browse repository at this point
Copy the full SHA c5d5589View commit details -
fix: Don't accept invalid step for
Period
(#122)* fix: Don't accept invalid intervals for periods If the specifier is a period specifier, ensure that the interval is larger than 0 (0 would be every 0th) and less than the max value for the unit. * fix: Move step check to appropriate function
Configuration menu - View commit details
-
Copy full SHA for cabee0f - Browse repository at this point
Copy the full SHA cabee0fView commit details
Commits on Nov 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for b29460f - Browse repository at this point
Copy the full SHA b29460fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2936553 - Browse repository at this point
Copy the full SHA 2936553View commit details
Commits on Dec 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6267780 - Browse repository at this point
Copy the full SHA 6267780View commit details -
Configuration menu - View commit details
-
Copy full SHA for c9a1230 - Browse repository at this point
Copy the full SHA c9a1230View commit details -
chore: Add
cargo fmt
andclippy
checks to GitHub action (#133)* chore: Add `cargo fmt` and `clippy` checks to GitHub action Followup from #117 and partly #123 addressing these issues. This is now checked in the GitHub action pipeline to avoid adding new violations. * chore: Update `actions/checkout` * fix: Fix `clippy` issues Remove lifetime annotations which can rely on lifetime elision.
Configuration menu - View commit details
-
Copy full SHA for ff948a8 - Browse repository at this point
Copy the full SHA ff948a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8667ec3 - Browse repository at this point
Copy the full SHA 8667ec3View commit details
Commits on Jan 14, 2025
-
Configuration menu - View commit details
-
Copy full SHA for ba64b92 - Browse repository at this point
Copy the full SHA ba64b92View commit details -
Configuration menu - View commit details
-
Copy full SHA for 956beaf - Browse repository at this point
Copy the full SHA 956beafView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.12.1...v0.15.0