diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib.rs | 13 | ||||
-rw-r--r-- | src/main.rs | 20 |
2 files changed, 18 insertions, 15 deletions
diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..85ba6c0 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,13 @@ +extern crate ical; +extern crate chrono; +extern crate chrono_tz; + +mod date; +mod event; +mod periodic; +mod calendar; +mod errors; + +pub use calendar::Calendar; +pub use date::Date; +pub use chrono::Duration; diff --git a/src/main.rs b/src/main.rs index 67eb0fc..6d9544b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,30 +1,20 @@ -extern crate ical; -extern crate chrono; -extern crate chrono_tz; - -mod date; -mod event; -mod periodic; -mod calendar; -mod errors; +extern crate almanac; use std::env; use std::io::BufReader; use std::fs::File; -use chrono::Duration; -use date::Date; -use calendar::Calendar; +use almanac::Duration; +use almanac::Date; +use almanac::Calendar; fn main() { let args: Vec<_> = env::args().collect(); let file = File::open(&args[1]).unwrap(); let buf = BufReader::new(file); let calendar = Calendar::parse(buf).unwrap(); - println!("{}", calendar); - println!(""); let now = Date::now(); - let events = calendar.get(&now, &(now + Duration::weeks(10))); + let events = calendar.get(&now, &(now + Duration::days(1))); for e in events { println!("{}", e); } |