- Commit
- 8b06eec966242f42785c2c9189f2541917a49549
- Parent
- 5b66f92343e29b8f2be9b84aa056a238ae8fc31e
- Author
- Pablo <pablo-escobar@riseup.net>
- Date
Cleaned some code
Yet another static page generator for photo galleries
Cleaned some code
1 file changed, 3 insertions, 6 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | src/main.rs | 9 | 3 | 6 |
diff --git a/src/main.rs b/src/main.rs @@ -61,8 +61,7 @@ fn main() -> io::Result<()> { /// Coordinates the rendering of all the pages and file conversions fn render_gallery(pics: Vec<Picture>) -> io::Result<()> { for pic in &pics { - let mut target_path = PathBuf::new(); - target_path.push(TARGET_PATH); + let mut target_path = PathBuf::from(TARGET_PATH); target_path.push(PHOTOS_PATH); target_path.push(&pic.file_name); @@ -87,8 +86,7 @@ fn render_gallery(pics: Vec<Picture>) -> io::Result<()> { } // TODO: Parallelize this - let mut thumb_path = PathBuf::new(); - thumb_path.push(TARGET_PATH); + let mut thumb_path = PathBuf::from(TARGET_PATH); thumb_path.push(THUMBS_PATH); for pic in &pics { pic.render_thumbnail(&thumb_path)?; @@ -156,8 +154,7 @@ fn render_index(pics: &Vec<Picture>) -> io::Result<()> { } fn render_pic_page(pic: &Picture) -> io::Result<()> { - let mut path = PathBuf::new(); - path.push(TARGET_PATH); + let mut path = PathBuf::from(TARGET_PATH); path.push(PAGES_PATH); path.push(pic.file_name.clone() + ".html");