Skip to content

Commit

Permalink
Add an example (named 'print') that writes to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
phrohdoh committed Dec 28, 2018
1 parent d828a69 commit ae08d33
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,12 @@ fn main() {
}
```

Currently this project only creates recurrence rule strings, it does not parse strings into typed object.
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.
13 changes: 13 additions & 0 deletions examples/print.rs
Original file line number Diff line number Diff line change
@@ -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),
]));
}

0 comments on commit ae08d33

Please sign in to comment.