From 0ddf24fa0be620fc10cc07247b2c738b32943042 Mon Sep 17 00:00:00 2001 From: Julian T Date: Mon, 26 Jul 2021 12:33:35 +0200 Subject: Added rendering of simple template --- src/main.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 28fe0c9..b647cdc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,13 +11,11 @@ fn main() { let ctx = Context::new_with_args().unwrap(); - for file in ctx.get_image_files().unwrap() { - println!("{}", file.display()); + let pieces = ctx.get_image_files().unwrap().iter() + .map(|file| Picture::new_from_file(&file).unwrap()) + .map(|pic| Piece::new(&ctx, pic).unwrap()) + .collect::>(); - let pic = Picture::new_from_file(&file).unwrap(); - println!("{:?}", pic); + piece::create_index(&ctx, &pieces[..]).unwrap(); - let piece = Piece::new(&ctx, pic).unwrap(); - println!("{:?}", piece); - } } -- cgit v1.2.3