Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: zslayton/cron
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.12.1
Choose a base ref
...
head repository: zslayton/cron
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.15.0
Choose a head ref
  • 14 commits
  • 18 files changed
  • 11 contributors

Commits on Oct 28, 2024

  1. 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
    LeoniePhiline authored Oct 28, 2024
    Configuration menu
    Copy the full SHA
    ef8e33a View commit details
    Browse the repository at this point in the history
  2. Run cargo fmt and fix all clippy 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.
    bombsimon authored Oct 28, 2024
    Configuration menu
    Copy the full SHA
    c491880 View commit details
    Browse the repository at this point in the history
  3. 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`.
    juancampa authored Oct 28, 2024
    Configuration menu
    Copy the full SHA
    e2fb958 View commit details
    Browse the repository at this point in the history
  4. 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()
    AhmedSoliman authored Oct 28, 2024
    Configuration menu
    Copy the full SHA
    bc07787 View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2024

  1. feat: implement optimized Serialize and Deserialize for Schedule (

    #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>
    LeoniePhiline and max-huster authored Oct 29, 2024
    Configuration menu
    Copy the full SHA
    c5d5589 View commit details
    Browse the repository at this point in the history
  2. 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
    bombsimon authored Oct 29, 2024
    Configuration menu
    Copy the full SHA
    cabee0f View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2024

  1. Configuration menu
    Copy the full SHA
    b29460f View commit details
    Browse the repository at this point in the history
  2. version bump to 0.13.0

    zslayton committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    2936553 View commit details
    Browse the repository at this point in the history

Commits on Dec 26, 2024

  1. Configuration menu
    Copy the full SHA
    6267780 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c9a1230 View commit details
    Browse the repository at this point in the history
  3. chore: Add cargo fmt and clippy 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.
    bombsimon authored Dec 26, 2024
    Configuration menu
    Copy the full SHA
    ff948a8 View commit details
    Browse the repository at this point in the history
  4. Version bump to v0.14.0

    zslayton committed Dec 26, 2024
    Configuration menu
    Copy the full SHA
    8667ec3 View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2025

  1. Configuration menu
    Copy the full SHA
    ba64b92 View commit details
    Browse the repository at this point in the history
  2. Version bump to 0.15.0

    zslayton committed Jan 14, 2025
    Configuration menu
    Copy the full SHA
    956beaf View commit details
    Browse the repository at this point in the history
Loading