Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Impl From<Schedule> for MultiSchedule
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Sebastian Puetz committed Mar 12, 2022
1 parent 1503043 commit b9c205e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.2] - 2022-03-12
### Added
- impl From<Schedule> for MultiSchedule

## [0.4.1] - 2022-03-08
### Added
- Added methods `ScheduleIter::assume_offset`, `ScheduleIter::use_local_offset` and pendants for `MultiScheduleIter` that allow to change the default offset (local) that dates are computed in to another.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cron-lingo"
version = "0.4.1"
version = "0.4.2"
authors = ["Peter Sebastian Pütz <ppuetz@protonmail.com>"]
edition = "2018"
repository = "https://github.com/puetzp/cron-lingo"
Expand Down
7 changes: 7 additions & 0 deletions src/schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ impl MultiSchedule {
}
}

impl From<Schedule> for MultiSchedule {
fn from(schedule: Schedule) -> Self {
let Schedule(schedule) = schedule;
MultiSchedule(vec![schedule])
}
}

impl std::ops::Add<Schedule> for MultiSchedule {
type Output = Self;

Expand Down

0 comments on commit b9c205e

Please sign in to comment.