From f9bdb7896c404eeeac3221ea35c84cfccdda276f Mon Sep 17 00:00:00 2001 From: Marc Plano-Lesay Date: Fri, 11 Oct 2024 11:46:53 +1100 Subject: [PATCH] Set-up rayon --- Cargo.lock | 1 + Cargo.toml | 1 + src/main.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index a65bb35..99622e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -243,6 +243,7 @@ dependencies = [ "log", "pdf-writer", "pretty_env_logger", + "rayon", "walkdir", "zip", ] diff --git a/Cargo.toml b/Cargo.toml index 6140600..342995a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,5 +9,6 @@ image = "0.25.2" log = "0.4.22" pdf-writer = "0.12.0" pretty_env_logger = "0.5.0" +rayon = "1.10.0" walkdir = "2.5.0" zip = "2.2.0" diff --git a/src/main.rs b/src/main.rs index af75cfe..53c30ec 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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