mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-15 23:32:37 +00:00
Refactor render for strict Clippy checks
This commit is contained in:
1 parent
33e23da8a9
commit
a11909551d
9 files changed
+22
-9
No files matched your search
@@ -1,7 +1,7 @@
|
||||
use super::core::{limited_pdf_string, pretty_date, spend};
|
||||
use super::model::{Annotation, AttachmentSource, DestView, Field, FieldKind, LayerOp, Link, LinkTarget, RemoteDestination, link_replies};
|
||||
use super::navigation::text_string;
|
||||
use super::*;
|
||||
use super::{Dictionary, DocInfo, Entry, HashMap, HashSet, Inspector, Object, ObjectId};
|
||||
|
||||
/// At most this many `/State` entries of a set-layer-visibility action are read.
|
||||
const MAX_LAYER_STATE: usize = 1024;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
use super::annotations::MAX_LINK_ATTACHMENT_TEXT_BYTES;
|
||||
use super::model::{AttachmentSource, PageInfo, Xfa};
|
||||
use super::navigation::text_string;
|
||||
use super::*;
|
||||
use super::{
|
||||
Arc, AssertUnwindSafe, DecryptionError, Dictionary, DocInfo, Document, HashMap, HashSet, LazyStructure, LoadOptions, LoadPdfError, Object,
|
||||
ObjectId, OnceCell, OpenError, Pdf, Structure, catch_unwind,
|
||||
};
|
||||
|
||||
/// lopdf decodes object and cross-reference streams while it loads, with no limit unless one is
|
||||
/// set: a few hundred bytes of nested FlateDecode then inflate to gigabytes. Real object and
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use super::*;
|
||||
use super::HashMap;
|
||||
|
||||
/// What kind of XFA form a document has (`/AcroForm /XFA`).
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
use super::core::inspect;
|
||||
use super::core::spend;
|
||||
use super::model::{DestView, OutlineItem, PageInfo};
|
||||
use super::*;
|
||||
use super::{
|
||||
BTreeMap, Dictionary, HashMap, HashSet, Inspector, MAX_LABEL_BYTES, MAX_LABEL_TOTAL_BYTES, MAX_LABEL_TREE_DEPTH, MAX_LABEL_TREE_WORK,
|
||||
MAX_PREFIX_BYTES, MAX_PREFIX_TOTAL_BYTES, Object, ObjectId, alpha, roman,
|
||||
};
|
||||
|
||||
/// `DocInfo::outline` holds the first this many bookmarks in outline order. Opening a document
|
||||
/// reads only this window; the rest are listed by page through `pdfcraft_organize`.
|
||||
|
||||
@@ -3,7 +3,7 @@ use super::core::inspect;
|
||||
use super::core::{Inspector, load_options};
|
||||
use super::model::{Attachment, AttachmentSource, FontInfo, Layer, PageTransition, TransitionStyle};
|
||||
use super::navigation::NameTreeSeen;
|
||||
use super::*;
|
||||
use super::{AssertUnwindSafe, Dictionary, DocInfo, Document, HashSet, Object, ObjectId, catch_unwind};
|
||||
|
||||
/// Decoded bytes read from an XFA form's configuration packet (or a whole-XDP `/XFA` stream) to
|
||||
/// find `dynamicRender`. Designer's packets are a few kilobytes; a whole XDP can hold the template.
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
use super::*;
|
||||
use super::{
|
||||
Arc, AssertUnwindSafe, AtomicBool, AtomicRenderStats, InterpreterSettings, JoinHandle, Mutex, Ordering, PageRenderer, Pdf, Pixels, Receiver,
|
||||
RenderCache, RenderConfig, RenderRequest, RenderStats, RenderedPage, RequestFailureKey, RequestKind, ResultReceiver, Stopwatch, SyncSender,
|
||||
WorkQueue, catch_unwind, finish, panic_message, parse, render_page, sync_channel, take_warnings, warning_settings,
|
||||
};
|
||||
|
||||
/// How long one page may render before the pool gives up on it (the watchdog).
|
||||
pub const STUCK_AFTER: std::time::Duration = std::time::Duration::from_secs(20);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
use super::layout::{Flow, along_baseline, arrange_flow, compatible, continues, from_upright, to_upright, unrolled};
|
||||
use super::*;
|
||||
use super::{
|
||||
Affine, BezPath, BlendMode, ClipPath, Context, Device, Glyph, GlyphDrawMode, HashMap, Image, InterpreterCache, InterpreterSettings, PageText,
|
||||
Paint, PathDrawMode, Pdf, Rect, Shape, SoftMask, TextFilter, TextGlyph, TransformExt, interpret_page,
|
||||
};
|
||||
|
||||
/// Largest sine of the angle between a glyph's writing direction and a flow's for the glyph to be
|
||||
/// laid out in that flow's frame. Turning an em box by θ moves its edges along the line by up to
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::device::{DIRECTION_TOLERANCE, Drawn, WORD_GAP};
|
||||
use super::order::{NONE, REDRAW_CANDIDATES, Run, Scratch, Seg, fingerprint, place_glyphs, redraws, restarts_run, reverse_rtl};
|
||||
use super::*;
|
||||
use super::{HashMap, PageText, TextGlyph};
|
||||
|
||||
/// Glyphs in reading order, as indices into the page's glyphs, with their lines and word gaps.
|
||||
pub(super) struct Flow {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::TextGlyph;
|
||||
use super::layout::{is_rtl, union};
|
||||
use super::*;
|
||||
|
||||
/// Glyphs `start..end` of the glyph list [`arrange`] lays out, drawn one after another.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
||||
Reference in new issue
Block a user