Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Aug 11, 2024
1 parent 8d5273b commit c17ee3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions examples/validate_file.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use aetolia::prelude::*;

fn main() {
let file_path = std::env::args().skip(1).next().expect("No file provided, should be the first argument");
let file_path = std::env::args()
.nth(1)
.expect("No file provided, should be the first argument");

let file = std::fs::File::open(&file_path).expect("Could not open file");
let calendar = load_ical(file).expect("Failed to load iCalendar data");

for (index, object) in calendar.iter().enumerate() {
let errors= validate_model(&object).expect("Failed to validate iCalendar data");
let errors = validate_model(object).expect("Failed to validate iCalendar data");
println!("Validated object: {:?}", index);

for error in &errors {
Expand All @@ -18,4 +20,4 @@ fn main() {
println!("Object is valid");
}
}
}
}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ pub mod common;
pub mod convert;
/// The core representation that is used for everything except the parser.
pub mod model;
/// The iCalendar parser.
pub mod parser;
/// Common operations.
pub mod ops;
/// The iCalendar parser.
pub mod parser;
/// The serializer for the core representation back to the iCalendar text format.
pub mod serialize;
#[cfg(test)]
Expand Down

0 comments on commit c17ee3b

Please sign in to comment.