Set-up rayon

This commit is contained in:
Marc Plano-Lesay 2024-10-11 11:46:53 +11:00
parent 60d254952b
commit f9bdb7896c
3 changed files with 4 additions and 1 deletions

View file

@ -1,6 +1,7 @@
use clap::{Parser, ValueHint};
use log::info;
use pdf_writer::{Content, Filter, Finish, Name, Pdf, Rect, Ref};
use rayon::prelude::*;
use std::ffi::OsStr;
use std::fs::File;
use std::io::Read;
@ -79,7 +80,7 @@ fn convert_cbz(cbz_path: &Path, output_dir: &Path) -> Result<(), Box<dyn std::er
}
}
images.sort_by_key(|img| img.name.clone());
images.par_sort_by_key(|img| img.name.clone());
let mut pdf = Pdf::new();
let catalog_id = Ref::new(1);