diff --git a/README.md b/README.md index d1fbce7..7e15066 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,12 @@ fn main() { } ``` -Currently this project only creates recurrence rule strings, it does not parse strings into typed object. \ No newline at end of file +Currently this project only creates recurrence rule strings, it does not parse strings into typed object. + +### Running the examples in this codebase + +``` +$ cargo run --example print +``` + +Change `print` to the name of whichever example you'd like to run. \ No newline at end of file diff --git a/examples/print.rs b/examples/print.rs new file mode 100644 index 0000000..043870f --- /dev/null +++ b/examples/print.rs @@ -0,0 +1,13 @@ +use rfc5545::{ + Frequency as Freq, + RecurRulePart as Part, + RecurrenceRule as Rule, +}; + +fn main() { + // Once per month, for 3 months total. + println!("{}", Rule::new_with_parts(vec![ + Part::Freq(Freq::Monthly), + Part::Count(3), + ])); +} \ No newline at end of file