Skip to content

Commit

Permalink
Bump version to 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Nov 23, 2024
1 parent cc5a0ee commit a271a17
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "croner"
version = "2.0.8"
version = "2.1.0"
edition = "2021"
license = "MIT"
description = "Fully-featured, lightweight, and efficient Rust library designed for parsing and evaluating cron patterns"
Expand All @@ -19,7 +19,7 @@ path = "src/lib.rs"
chrono = "0.4.38"

[dev-dependencies]
chrono-tz = "0.9.0"
chrono-tz = "0.10.0"
criterion = "0.5.1"

[[bench]]
Expand Down
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,9 +1214,7 @@ mod tests {
use chrono::TimeZone;

// Parse the cron expression with specified options
let cron = Cron::new("0 0 0 * * 7#2")
.with_seconds_optional()
.parse()?;
let cron = Cron::new("0 0 0 * * 7#2").with_seconds_optional().parse()?;

// Define the start date for the test
let start_date = Local.with_ymd_and_hms(2024, 10, 1, 0, 0, 0).unwrap();
Expand Down
9 changes: 8 additions & 1 deletion src/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ impl CronPattern {
// Handle conversion of 7 to 0 for day_of_week if necessary
// this has to be done last because range could be 6-7 (sat-sun)
if !self.with_alternative_weekdays {
for nth_bit in [ALL_BIT, NTH_1ST_BIT, NTH_2ND_BIT, NTH_3RD_BIT, NTH_4TH_BIT, NTH_5TH_BIT] {
for nth_bit in [
ALL_BIT,
NTH_1ST_BIT,
NTH_2ND_BIT,
NTH_3RD_BIT,
NTH_4TH_BIT,
NTH_5TH_BIT,
] {
if self.days_of_week.is_bit_set(7, nth_bit)? {
self.days_of_week.unset_bit(7, nth_bit)?;
self.days_of_week.set_bit(0, nth_bit)?;
Expand Down

0 comments on commit a271a17

Please sign in to comment.