diff --git a/Cargo.toml b/Cargo.toml index a44b74e..4742120 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -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]] diff --git a/src/lib.rs b/src/lib.rs index 9c38156..9b2b334 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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(); diff --git a/src/pattern.rs b/src/pattern.rs index 92b6807..c81de2e 100644 --- a/src/pattern.rs +++ b/src/pattern.rs @@ -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)?;