Skip to content

Commit

Permalink
chore: clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dilawar committed Dec 17, 2023
1 parent b39151e commit d147458
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl FromStr for CronWithRandomness {
let shorthand = &caps["shorthand"];
let cs = &caps["constraints"];

let inner = Schedule::from_str(&shorthand)?;
let inner = Schedule::from_str(shorthand)?;
let mut constraints = HashMap::new();

for constraint in cs.split(',') {
Expand Down Expand Up @@ -191,14 +191,14 @@ mod tests {
let sch = CronWithRandomness::from_str("@weekly{d=1-3,h=21-23}").unwrap();
println!("{sch:?}");

let mut acc = SimpleAccumulator::with_fixed_capacity::<f64>(&[], 10, true);
let _acc = SimpleAccumulator::with_fixed_capacity::<f64>(&[], 10, true);

let mut schedules = vec![];
for datetime in sch.upcoming(Utc).take(100) {
let weekday = datetime.weekday().num_days_from_sunday();
let hour = datetime.time().hour();
assert!(vec![1, 2, 3].contains(&weekday));
assert!(vec![21, 22, 23].contains(&hour));
assert!([1, 2, 3].contains(&weekday));
assert!([21, 22, 23].contains(&hour));
schedules.push(datetime);
println!("--> {datetime:?} weekday={weekday:?} hour={hour:?}");
}
Expand Down

0 comments on commit d147458

Please sign in to comment.