Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
rust-version: [ "1.80.0", "stable" ]
rust-version: [ "1.85.0", "stable" ]
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
Expand Down
99 changes: 57 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@

[package]
name = "cronexpr"
version = "1.3.1"
version = "1.4.0"

description = "A library to parse and drive the crontab expression."
edition = "2021"
edition = "2024"
homepage = "https://github.com/fast/cronexpr"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/fast/cronexpr"
rust-version = "1.80.0"
rust-version = "1.85.0"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
jiff = { version = "0.2.0" }
winnow = { version = "0.7.13" }
jiff = { version = "0.2.16" }
winnow = { version = "0.7.14" }

[dev-dependencies]
insta = { version = "1.41", features = ["filters"] }
insta = { version = "1.44.3", features = ["filters"] }
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

[![Crates.io][crates-badge]][crates-url]
[![Documentation][docs-badge]][docs-url]
[![MSRV 1.80][msrv-badge]](https://www.whatrustisit.com)
[![MSRV 1.85][msrv-badge]](https://www.whatrustisit.com)
[![Apache 2.0 licensed][license-badge]][license-url]
[![Build Status][actions-badge]][actions-url]

[crates-badge]: https://img.shields.io/crates/v/cronexpr.svg
[crates-url]: https://crates.io/crates/cronexpr
[docs-badge]: https://docs.rs/cronexpr/badge.svg
[msrv-badge]: https://img.shields.io/badge/MSRV-1.80-green?logo=rust
[msrv-badge]: https://img.shields.io/badge/MSRV-1.85-green?logo=rust
[docs-url]: https://docs.rs/cronexpr
[license-badge]: https://img.shields.io/crates/l/cronexpr
[license-url]: LICENSE
Expand Down Expand Up @@ -92,7 +92,14 @@ fn main() {

## Who is using `cronexpr`?

The original purpose of this library is to be used in [supporting `CREATE JOB` in ScopeDB](https://docs.scopedb.io/reference/commands/stmt-ddl/#create-job).
The original purpose of this library is to be used in the internal `CREATE JOB` statement in ScopeDB, whose syntax looks like this:

```sql
CREATE JOB do_retention
SCHEDULE = '* * * * * Asia/Shanghai'
AS
DELETE FROM t WHERE now() - ts > 'PT10s'::interval;
```

If you are using `cronexpr` in your project, please feel free to open a PR to add your project to this list.

Expand All @@ -107,7 +114,7 @@ If you are using `cronexpr` in your project, please feel free to open a PR to ad

## Minimum Rust version policy

This crate is built against the latest stable release, and its minimum supported rustc version is 1.80.0.
This crate is built against the latest stable release, and its minimum supported rustc version is 1.85.0.

The policy is that the minimum Rust version required to use this crate can be increased in minor version updates. For example, if cronexpr 1.0 requires Rust 1.20.0, then cronexpr 1.0.z for all values of z will also require Rust 1.20.0 or newer. However, cronexpr 1.y for y > 0 may require a newer minimum version of Rust.

Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
//!
//! ## Why do you create this crate?
//!
//! The other day when I was implementing [`CREATE JOB` in ScopeDB](https://docs.scopedb.io/reference/commands/stmt-ddl/#create-job),
//! The other day when I was implementing the internal `CREATE JOB` statement in ScopeDB,
//! it comes to a requirement to support parsing and driving a crontab expression.
//!
//! Typically, the language interface looks like:
Expand Down Expand Up @@ -468,22 +468,22 @@ use std::collections::HashSet;
use std::fmt;
use std::str::FromStr;

use jiff::civil::Weekday;
use jiff::tz::TimeZone;
use jiff::RoundMode;
use jiff::Span;
use jiff::Timestamp;
use jiff::ToSpan;
use jiff::Unit;
use jiff::Zoned;
use jiff::ZonedRound;
use jiff::civil::Weekday;
use jiff::tz::TimeZone;

mod parser;
pub use parser::FallbackTimezoneOption;
pub use parser::ParseOptions;
pub use parser::normalize_crontab;
pub use parser::parse_crontab;
pub use parser::parse_crontab_with;
pub use parser::FallbackTimezoneOption;
pub use parser::ParseOptions;

pub extern crate jiff;

Expand Down
Loading