From 4accdf6b005cf9047c43c15ad00b1918d3d8a21a Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 27 Oct 2026 13:04:59 +0000 Subject: [PATCH] refactor(doc): clarify appearance and document dependencies --- crates/doc/src/appearance/layers.rs | 2 +- crates/doc/src/appearance/profile.rs | 2 +- crates/doc/src/appearance/stroke_style.rs | 2 +- crates/doc/src/artboard.rs | 2 +- crates/doc/src/document.rs | 5 ++++- crates/doc/src/document_ext.rs | 5 ++++- crates/doc/src/document_guides.rs | 2 +- crates/doc/src/graphic_style.rs | 2 +- crates/doc/src/guides.rs | 2 +- crates/doc/src/limits.rs | 2 +- crates/doc/src/records.rs | 2 +- crates/doc/src/units.rs | 2 +- 12 files changed, 18 insertions(+), 12 deletions(-) diff --git a/crates/doc/src/appearance/layers.rs b/crates/doc/src/appearance/layers.rs index 6103e7dfd..dd5c41325 100644 --- a/crates/doc/src/appearance/layers.rs +++ b/crates/doc/src/appearance/layers.rs @@ -1,6 +1,6 @@ use super::profile::{PressureProfile, WidthProfile}; use super::stroke_style::{ArrowAlign, Arrowhead, Dash, LineCap, LineJoin, StrokeAlign}; -use super::*; +use super::{BlendMode, Deserialize, Paint, Serialize}; /// A live effect in an appearance stack. Parameters are interpreted by `vectorcraft-effects`. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/crates/doc/src/appearance/profile.rs b/crates/doc/src/appearance/profile.rs index 56df51ef6..ccae9666b 100644 --- a/crates/doc/src/appearance/profile.rs +++ b/crates/doc/src/appearance/profile.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Deserialize, Serialize}; /// Variable-width profile: (position 0..1 along the path, left width factor, right width factor), /// in order along the path. Two points at the same position make a discontinuous point: the diff --git a/crates/doc/src/appearance/stroke_style.rs b/crates/doc/src/appearance/stroke_style.rs index 3e6a29a32..acd4d8189 100644 --- a/crates/doc/src/appearance/stroke_style.rs +++ b/crates/doc/src/appearance/stroke_style.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Deserialize, Serialize}; #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum LineCap { diff --git a/crates/doc/src/artboard.rs b/crates/doc/src/artboard.rs index bdd20f4c8..b78b8eb01 100644 --- a/crates/doc/src/artboard.rs +++ b/crates/doc/src/artboard.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Arc, Deserialize, Node, NodeId, NodeKind, Rect, Serialize, SymbolBoxes, skip}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Artboard { diff --git a/crates/doc/src/document.rs b/crates/doc/src/document.rs index a17b430be..478e54ca8 100644 --- a/crates/doc/src/document.rs +++ b/crates/doc/src/document.rs @@ -3,7 +3,10 @@ use super::graphic_style::default_graphic_styles; use super::guides::{GridPrefs, RulerMode}; use super::limits::{DocError, FORMAT_VERSION, MAX_COORD, MAX_NEXT_ID}; use super::units::{ColorMode, Unit}; -use super::*; +use super::{ + Arc, BTreeMap, ColorProfiles, DocMetadata, DocSetup, Document, LAYER_COLORS, LayerColor, Node, NodeId, NodeKind, PatternDef, Places, Point, + RasterEffectsSettings, Rect, Vec2, +}; impl Document { /// Is everything but the layers the same in `other`, as the next version of the document after diff --git a/crates/doc/src/document_ext.rs b/crates/doc/src/document_ext.rs index 9d17f689a..c0c85b124 100644 --- a/crates/doc/src/document_ext.rs +++ b/crates/doc/src/document_ext.rs @@ -1,7 +1,10 @@ use super::graphic_style::GraphicStyle; use super::limits::MAX_NEXT_ID; use super::records::{ImageBlob, SavedSelection, SavedView}; -use super::*; +use super::{ + Arc, Document, ImageObject, Node, NodeKind, SYMBOL_EXPORT_TYPE, SYMBOL_NINE_SLICE, SYMBOL_REGISTRATION, SymbolExportType, SymbolNineSlice, + SymbolRegistration, +}; impl Document { /// The pixels image `im` shows: its own ([`ImageObject::pixels`]) or this document's. diff --git a/crates/doc/src/document_guides.rs b/crates/doc/src/document_guides.rs index 96af5c75b..43e1c4c92 100644 --- a/crates/doc/src/document_guides.rs +++ b/crates/doc/src/document_guides.rs @@ -1,6 +1,6 @@ use super::document_ext::free_id; use super::guides::Guide; -use super::*; +use super::{Affine, Arc, Document, Node, NodeId, NodeKind, PatternDef, Point, Rect, Selection, SymbolBoxes, Vec2, artboard_holds}; impl Document { /// Union of the geometric bounds of `ids` (their visual bounds when `visual`), with symbol diff --git a/crates/doc/src/graphic_style.rs b/crates/doc/src/graphic_style.rs index 95c61b6eb..789684736 100644 --- a/crates/doc/src/graphic_style.rs +++ b/crates/doc/src/graphic_style.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Appearance, Deserialize, Knockout, Node, Rect, Serialize, skip}; /// A named graphic style (Graphic Styles panel): an appearance plus the object's transparency. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] diff --git a/crates/doc/src/guides.rs b/crates/doc/src/guides.rs index 0c10efff2..08f828391 100644 --- a/crates/doc/src/guides.rs +++ b/crates/doc/src/guides.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Deserialize, NodeId, Serialize, Vec2}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Guide { diff --git a/crates/doc/src/limits.rs b/crates/doc/src/limits.rs index e030f3d71..027148ade 100644 --- a/crates/doc/src/limits.rs +++ b/crates/doc/src/limits.rs @@ -1,4 +1,4 @@ -use super::*; +use super::NodeId; /// Coordinates beyond this many points exceed the supported document range. pub const MAX_COORD: f64 = 4.0e6; diff --git a/crates/doc/src/records.rs b/crates/doc/src/records.rs index e9af0e682..b13a1e955 100644 --- a/crates/doc/src/records.rs +++ b/crates/doc/src/records.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Arc, Deserialize, Node, NodeId, Point, Serialize}; /// New art on a locked artboard ([`Document::new_art`]). Setting it changes the document in /// place, so a selection change that sets it doesn't replace the document. diff --git a/crates/doc/src/units.rs b/crates/doc/src/units.rs index 1b09c4e7b..2c1fc8653 100644 --- a/crates/doc/src/units.rs +++ b/crates/doc/src/units.rs @@ -1,4 +1,4 @@ -use super::*; +use super::{Deserialize, Serialize}; /// Measurement units (display only; the model is always in points). #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]