diff --git a/src/main.rs b/src/main.rs
@@ -1,13 +1,15 @@
use crossterm::style::Stylize;
use image::io::Reader as ImageReader;
use image::DynamicImage;
-use std::env;
-use std::fmt::{self, Display};
-use std::fs::{self, File};
-use std::io::{self, Write};
-use std::path::PathBuf;
-use std::process::ExitCode;
-use std::sync::mpsc;
+use std::{
+ env,
+ fmt::{self, Display},
+ fs::{self, File},
+ io::{self, Write},
+ path::PathBuf,
+ process::ExitCode,
+ sync::mpsc,
+};
use picture::Picture;
use threadpool::ThreadPool;
@@ -129,14 +131,14 @@ fn main() -> ExitCode {
Err(err) => {
error!("Couldn't open {config:?}: {err}",
config = config, err = err; newline = false);
- return ExitCode::FAILURE;
+ ExitCode::FAILURE
}
// Error parsing the config file
Ok(Err(err)) => {
error!("Couldn't parse {config:?}: {err}",
config = config, err = err; newline = false);
usage_config!();
- return ExitCode::FAILURE;
+ ExitCode::FAILURE
}
Ok(Ok(pics)) => render_gallery(pics),
}
@@ -201,14 +203,14 @@ fn render_gallery(pics: Vec<Picture>) -> ExitCode {
// ========================================================================
log!("Rendering index.html...");
- if let Err(_) = render_index(&pics) {
+ if render_index(&pics).is_err() {
return ExitCode::FAILURE;
}
log_done!();
for pic in pics {
log!("Rendering HTML page for {name:?}...", name = pic.file_name);
- if let Err(_) = render_pic_page(&pic) {
+ if render_pic_page(&pic).is_err() {
return ExitCode::FAILURE;
}
log_done!();