From c76a20e37c718cf6077e038a3acda2c7741b1b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Nordstr=C3=B8m?= Date: Sat, 22 Feb 2025 19:36:05 +0100 Subject: [PATCH] Add bin using crate english-to-cron. --- src/bin/using-crate-english-to-cron.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/bin/using-crate-english-to-cron.rs diff --git a/src/bin/using-crate-english-to-cron.rs b/src/bin/using-crate-english-to-cron.rs new file mode 100644 index 0000000..c053bae --- /dev/null +++ b/src/bin/using-crate-english-to-cron.rs @@ -0,0 +1,15 @@ +fn main() { + let texts = vec![ + "every 15 seconds", + "every minute", + "every day at 4:00 pm", + "at 10:00 am", + "Run at midnight on the 1st and 15th of the month", + "on Sunday at 12:00", + ]; + + for text in texts { + let res = english_to_cron::str_cron_syntax(text); + println!("{text}: {res:#?}"); + } +}