Skip to content

4.0.0

Choose a tag to compare

@Hexagon Hexagon released this 31 Aug 22:18
· 2 commits to main since this release
9babd91

Croner 4.0.0 Release Notes

Major Features & New Backends

  • Generic CronDateTime Trait & Jiff Support: Introduced a backend-agnostic CronDateTime trait by @ion-elgreco (#48), adding an optional, high-performance jiff datetime backend alongside chrono (#49). The chrono backend is now placed behind an optional feature flag (enabled by default).
  • LW & 31W Support: Added support for the LW (last weekday) pattern and verified 31W behavior ([#37](#37)).
  • OCPS-Compliant Validation: Added OCPS-compliant step syntax validation with an optional sloppy_ranges mode ([#39](#39)).
  • Derive Traits: Derived Eq and Ord implementations for Cron by @CardboardTurkey ([#43](#43)).

Improvements, Bug Fixes & Refactoring

  • Performance & Hot Paths: Cut redundant work out of the day-matching hot path by @ion-elgreco ([#46](#46)) and refactored day matching to use a weekday value instead of a calendar type ([#47](#47)).
  • DST Iteration Fixes: Fixed iteration during DST overlap and Jiff DST handling by @ion-elgreco ([#53](#53)).
  • Chrono Feature Reduction: Reduced features of chrono by @paolobarbolini ([#42](#42)) and isolated it behind a feature flag.
  • Testing & Documentation: Added test verification for case-insensitivity of aliases and modifiers ([#40](#40)), added a Quartz Compatibility section ([#41](#41)), and updated README and simple_demo to use the Jiff backend ([#52](#52)).

Breaking Changes & Migration Guide

Version 4.0 introduces architectural upgrades that may require code adjustments. For complete details, consult the official MIGRATION.md guide. Key breaking changes include:

  • Optional Chrono Feature: chrono is now an optional feature flag (enabled by default). If your project compiles with default-features = false, you must explicitly add "chrono" or "jiff" to your Cargo.toml.
  • Stricter Step Syntax Validation: Shortcut step syntax (e.g., 5/5 * * * *) is now rejected by default and requires explicit ranges like 5-59/5 * * * *. You can restore the old lenient behavior by building your parser with .sloppy_ranges(true).
  • Generic Datetime Methods: Methods now bind on the new CronDateTime trait instead of chrono::TimeZone. Return types match the input type. When type inference is ambiguous (e.g., with multiple backends enabled), a turbofish annotation may be needed:
let next = cron
    .find_next_occurrence::<chrono::DateTime<chrono::Utc>>(&chrono::Utc::now(), false)
    .unwrap();
  • Removed/Deprecated APIs:
  • The internal tuple-returning find_occurrence method has been removed from the public API; use find_next_occurrence instead.
  • The crate-level croner::from_naive function is deprecated; use chrono::TimeZone::from_local_datetime directly.
  • CronIterator<Tz> has been renamed to CronIterator<T>.

New Contributors

Full Changelog: v3.0.1...v4.0.0