From 9ee72e03b3ab4b8ef740a0c61aebe08179d44863 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Fri, 21 Jun 2024 16:47:08 +0200 Subject: [PATCH] WZ2 ? --- Cargo.toml | 10 +++++----- src/makepdf.rs | 43 +++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e196ff6..95fec29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = "1.0.82" -clap = { version = "4.5.4", features = ["derive"] } +anyhow = "1.0.86" +clap = { version = "4.5.7", features = ["derive"] } csv = "1.3.0" debug_print = "1.0.0" dynfmt = { version = "0.1.5", features = ["curly"] } @@ -16,11 +16,11 @@ enum_dispatch = "0.3.13" futures = "0.3.30" glob = "0.3.1" phf = { version = "0.11.2", features = ["macros"] } -regex = "1.10.4" +regex = "1.10.5" regex_static = "0.1.1" -serde = { version = "1.0.198", features = ["derive"] } +serde = { version = "1.0.203", features = ["derive"] } tokio = { version = "1.38.0", features = ["full"] } -toml = "0.8.12" +toml = "0.8.14" [profile.dev] debug = 0 diff --git a/src/makepdf.rs b/src/makepdf.rs index be56e15..799655f 100644 --- a/src/makepdf.rs +++ b/src/makepdf.rs @@ -124,25 +124,24 @@ async fn launch_subprocess(args: &MakeConfig) -> Result { Ok(status) } -// /// The line encountered -// enum LineType { -// /// The tex building mode -// Mode, -// Info, -// BoxFullness, -// /// Unknown type -// Unknown(String), -// } -// /// Check each line and changes the status and/or display according warnings -// fn checkline(s: &str, status: &mut Status, context: &mut Vec) -> Result<()> { -// // Match the line to guess what is happening -// // match s { -// // s if s.starts_with("entering_extended_mode") => LineType::Mode, -// // _ => LineType::Unknown(s.to_string()), -// // } -// // status.warnings += 1; -// // if status.warnings % 3 == 0 { -// // println!("{}", s); -// // } -// Ok(()) -// } +/// The line encountered +#[derive(Debug)] +enum LineType { + /// The tex building mode + Mode, + Info, + BoxFullness, + /// Unknown type + Unknown(String), +} +/// Check each line and changes the status and/or display according warnings +fn checkline(s: &str, status: &mut Status, context: &mut Vec) -> Result<()> { + // Match the line to guess what is happening + let line = match s { + s if s.starts_with("entering_extended_mode") => LineType::Mode, + _ => LineType::Unknown(s.to_string()), + }; + // status.warnings += 1; + println!("{:?}", line); + Ok(()) +}