PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
Refactor pdfcraft-cli for strict Clippy checks
Dylan M. Taylor530e2a264505
diff --git a/apps/pdfcraft-cli/src/check.rs b/apps/pdfcraft-cli/src/check.rsindex 1821f8582..62993ad6d 100644--- a/apps/pdfcraft-cli/src/check.rs+++ b/apps/pdfcraft-cli/src/check.rs@@ -1,6 +1,8 @@use super::commands::{parse_dpi, read};use super::options::{AUDIT_OPTIONS, CHECK_ONE_OPTIONS, CHECK_OPTIONS, flag, positional, validate_options};-use super::*;+use super::{+ Arc, CliError, Command, Duration, Instant, PageRenderer, Path, PathBuf, RenderConfig, RenderRequest, RequestKind, Stdio, inspect, stdout_line,+};/// Audit a document for faux redactions. Prints the findings as JSON; fails when any are/// found so scripts and CI can gate on it, and when the audit itself cannot run.diff --git a/apps/pdfcraft-cli/src/commands.rs b/apps/pdfcraft-cli/src/commands.rsindex 5efec8331..9d0b2057f 100644--- a/apps/pdfcraft-cli/src/commands.rs+++ b/apps/pdfcraft-cli/src/commands.rs@@ -2,7 +2,7 @@ use super::options::{COMBINE_OPTIONS, EXTRACT_OPTIONS, INFO_OPTIONS, RENDER_OPTIONS, SPLIT_OPTIONS, TEXT_OPTIONS, can_be_path_value, flag, needs_value, positional,validate_options,};-use super::*;+use super::{Arc, CliError, ImageFormat, PageRenderer, Path, PathBuf, RenderConfig, RenderRequest, RequestKind, Write, inspect, stdout_line};pub(crate) fn read(path: &str) -> Result<Arc<Vec<u8>>, String> {std::fs::read(path).map(Arc::new).map_err(|e| format!("{path}: {e}"))diff --git a/apps/pdfcraft-cli/src/options.rs b/apps/pdfcraft-cli/src/options.rsindex ab1a3db34..1ddbfabcd 100644--- a/apps/pdfcraft-cli/src/options.rs+++ b/apps/pdfcraft-cli/src/options.rs@@ -1,4 +1,4 @@-use super::*;+use super::CliError;pub(crate) fn flag<'a>(args: &'a [String], name: &str) -> Option<&'a str> {args.iter().position(|a| a == name).and_then(|i| args.get(i + 1)).map(String::as_str)diff --git a/apps/pdfcraft-cli/src/run.rs b/apps/pdfcraft-cli/src/run.rsindex 19eed2187..0726087d9 100644--- a/apps/pdfcraft-cli/src/run.rs+++ b/apps/pdfcraft-cli/src/run.rs@@ -1,7 +1,9 @@#[cfg(feature = "mcp")]use super::options::MCP_OPTIONS;use super::options::{RUN_OPTIONS, flag, positional, validate_options};-use super::*;+#[cfg(feature = "mcp")]+use super::{Arc, Path, Write, automation_args};+use super::{CliError, stdout_line};// ---- automation --------------------------------------------------------------------------------diff --git a/apps/pdfcraft-cli/src/ui.rs b/apps/pdfcraft-cli/src/ui.rsindex 9d1223352..dc419171b 100644--- a/apps/pdfcraft-cli/src/ui.rs+++ b/apps/pdfcraft-cli/src/ui.rs@@ -1,5 +1,5 @@use super::options::{UI_OPTIONS, flag, positional, validate_options};-use super::*;+use super::{CliError, Duration, stdout_line};// ---- UI control channel client -----------------------------------------------------------------