18 lines
608 B
Rust
18 lines
608 B
Rust
use std::fs::File;
|
|
use std::env;
|
|
use journal_types;
|
|
use serde_json;
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
let args: Vec<String> = env::args().collect();
|
|
let file = File::open(args[1].clone())?;
|
|
let mut export_data: journal_types::ExportData =
|
|
serde_json::from_reader(file)?;
|
|
export_data.experiences.sort_by(|a, b| a.modified_time.cmp(&b.modified_time));
|
|
for experience in export_data.experiences.iter_mut() {
|
|
experience.ingestions.sort_by(|a,b| a.ingestion_time.cmp(&b.ingestion_time));
|
|
}
|
|
println!("Hello, world! {:?}", export_data);
|
|
Ok(())
|
|
}
|