mod context; mod picture; mod piece; use std::error::Error; use context::Context; use picture::Picture; use piece::Piece; fn main() -> Result<(), Box> { println!("Hello, world!"); let ctx = Context::new_with_args()?; let mut pieces = ctx.get_image_files()?.iter() .map(|file| -> Result> { let pic = Picture::new_from_file(&file)?; Ok(Piece::new(&ctx, pic)?) }).collect::, Box>>()?; pieces.sort(); pieces.reverse(); piece::create_index(&ctx, &pieces[..])?; Ok(()) }