From c618e402fa89a6af3552ed1fec33f03fafc46a66 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Tue, 27 Oct 2026 14:00:36 +0000 Subject: [PATCH] refactor(format): replace wildcard imports --- crates/format/src/fig/export/assets.rs | 5 ++++- crates/format/src/fig/export/common.rs | 6 +++++- crates/format/src/fig/export/component.rs | 2 +- crates/format/src/fig/export/layer.rs | 6 +++++- crates/format/src/fig/export/paint.rs | 5 ++++- crates/format/src/fig/export/prototype.rs | 5 ++++- crates/format/src/fig/export/shape.rs | 6 +++++- crates/format/src/fig/kiwi.rs | 2 +- crates/format/src/fig/map/component.rs | 2 +- crates/format/src/fig/map/connector.rs | 2 +- crates/format/src/fig/map/document.rs | 2 +- crates/format/src/fig/map/layout.rs | 2 +- crates/format/src/fig/map/paint.rs | 2 +- crates/format/src/fig/map/proto.rs | 2 +- crates/format/src/fig/map/text.rs | 2 +- crates/format/src/fig/map/variables.rs | 2 +- 16 files changed, 37 insertions(+), 16 deletions(-) diff --git a/crates/format/src/fig/export/assets.rs b/crates/format/src/fig/export/assets.rs index 00c84639..bd269556 100644 --- a/crates/format/src/fig/export/assets.rs +++ b/crates/format/src/fig/export/assets.rs @@ -1,5 +1,8 @@ use super::common::{layout_grid, node_field, prop_type, resolved_type, scope_name, variant_pairs}; -use super::*; +use super::{ + AUX, Action, Affine, Bound, Color, Exporter, Fields, Kv, LAYERS, MAX_NODES, Node, NodeId, NodeKind, Overlay, OverlayPosition, Paint, StyleKind, + TextData, VariableValue, arr, b, color, e, fl, guid, matrix, o, position, root_fields, s, u, xy, +}; impl<'d> Exporter<'d> { /// GUIDs for every layer (pages first, then depth-first), component property definitions, diff --git a/crates/format/src/fig/export/common.rs b/crates/format/src/fig/export/common.rs index 2853dd72..4a97eecb 100644 --- a/crates/format/src/fig/export/common.rs +++ b/crates/format/src/fig/export/common.rs @@ -1,4 +1,8 @@ -use super::*; +use super::{ + Bound, ExportSize, Fields, GAMEPAD_BUTTONS, GridAlign, GridKind, KeyMods, Kv, LetterSpacing, LineHeight, MAX_NETWORK, Node, NodeKind, Paint, + PropDef, SCHEMA, TextCase, TextDecoration, TextStyle, VariableType, VectorNetwork, WindingRule, arr, b, color, e, face_style, fl, guid, int, o, + s, xy, +}; /// Longest kept description of such a layer (bytes of JSON). const MAX_STASH: usize = 1 << 20; diff --git a/crates/format/src/fig/export/component.rs b/crates/format/src/fig/export/component.rs index 7d88dcc8..2342386b 100644 --- a/crates/format/src/fig/export/component.rs +++ b/crates/format/src/fig/export/component.rs @@ -1,7 +1,7 @@ use super::common::{ bool_data, changed, prop_type, resolved_alike, scaled, sort_position, symbol_data, text_data, text_value, var_data, variant_pairs, }; -use super::*; +use super::{AUX, BTreeMap, Exporter, Fields, Kv, MAX_NODES, Node, NodeId, NodeKind, PropDef, Value, arr, b, e, fl, guid, o, s}; impl<'d> Exporter<'d> { /// A component property definition of `owner` (a component, or a set), `index`-th in its list. diff --git a/crates/format/src/fig/export/layer.rs b/crates/format/src/fig/export/layer.rs index 9925042f..55fd6dd9 100644 --- a/crates/format/src/fig/export/layer.rs +++ b/crates/format/src/fig/export/layer.rs @@ -1,5 +1,9 @@ use super::common::{export_setting, layout_grid, outlined, prop_type, variant_pairs}; -use super::*; +use super::{ + AUX, AutoLayout, BoolOp, Bound, ContentAlign, CrossAlign, Exporter, Fields, HConstraint, Kv, LAYERS, LayoutMode, MAX_DEPTH, MainAlign, MaskType, + Node, NodeId, NodeKind, PropDef, STASH, Sizing, TextData, TextStyle, VConstraint, WindingRule, arr, b, blend_name, color, e, fl, grid_sizing, + guid, int, matrix, o, position, root_fields, s, u, xy, +}; impl<'d> Exporter<'d> { /// Write layer `id` (child `index` of the layer with GUID `parent_guid`) and its subtree. diff --git a/crates/format/src/fig/export/paint.rs b/crates/format/src/fig/export/paint.rs index f0f40c18..26718e44 100644 --- a/crates/format/src/fig/export/paint.rs +++ b/crates/format/src/fig/export/paint.rs @@ -1,5 +1,8 @@ use super::common::one_sided; -use super::*; +use super::{ + Affine, Bound, EffectKind, Exporter, Fields, GradientKind, ImageScaleMode, Kv, MAX_IMAGE, Node, NodeKind, NoiseMode, Paint, PaintKind, + StrokeAlign, StrokeCap, arr, b, blend_name, cap_name, color, e, fl, join_name, matrix, o, s, sha1_hex, xy, +}; impl<'d> Exporter<'d> { /// A paint list: a layer's fills (`fills`) or strokes with the variables `bound` to them. diff --git a/crates/format/src/fig/export/prototype.rs b/crates/format/src/fig/export/prototype.rs index 866b03c4..01c20db0 100644 --- a/crates/format/src/fig/export/prototype.rs +++ b/crates/format/src/fig/export/prototype.rs @@ -1,5 +1,8 @@ use super::common::key_codes; -use super::*; +use super::{ + Action, Direction, Easing, Exporter, Fields, Interaction, Kv, Node, NodeId, Overflow, OverlayPosition, ScrollPosition, Transition, Trigger, arr, + b, color, e, fl, int, o, position, s, +}; impl<'d> Exporter<'d> { /// Interactions, scrolling, flow starts and the overlay settings this layer is opened with. diff --git a/crates/format/src/fig/export/shape.rs b/crates/format/src/fig/export/shape.rs index 7ef79a78..ba420527 100644 --- a/crates/format/src/fig/export/shape.rs +++ b/crates/format/src/fig/export/shape.rs @@ -1,5 +1,9 @@ use super::common::{style_fields, unsupported_decoration_look}; -use super::*; +use super::{ + Affine, BezPath, Bound, Exporter, Fields, Kv, ListStyle, MAX_CANVAS, MAX_CHARS, MAX_NETWORK, Node, NodeKind, Paint, StrokeAlign, StrokeCap, + StrokeJoin, TextAlignH, TextAlignV, TextAutoResize, TextData, TextStyle, VectorNetwork, WindingRule, arr, b, cap_name, e, finite, fl, int, + join_name, network, o, path_blob, s, u, xy, +}; impl<'d> Exporter<'d> { /// Text: its style, box settings, and characters with their styled runs. `fills`: the layer's diff --git a/crates/format/src/fig/kiwi.rs b/crates/format/src/fig/kiwi.rs index 0f431082..82bdc6cd 100644 --- a/crates/format/src/fig/kiwi.rs +++ b/crates/format/src/fig/kiwi.rs @@ -400,7 +400,7 @@ impl<'s> Decoder<'s, '_> { /// An encoder for the same format: the `.fig` export writes its schema and message with it (and /// test fixtures are built with it). Values are checked against the schema; it never panics. pub mod encode { - use super::*; + use super::{BUILTINS, Field, Kind, KiwiError, Kv, MAX_DEPTH, Schema, Type, err}; #[derive(Default)] pub struct Writer(pub Vec); diff --git a/crates/format/src/fig/map/component.rs b/crates/format/src/fig/map/component.rs index abc2225e..227c18aa 100644 --- a/crates/format/src/fig/map/component.rs +++ b/crates/format/src/fig/map/component.rs @@ -1,6 +1,6 @@ use super::layer::own_text; use super::text::char_styles; -use super::*; +use super::{BTreeMap, BTreeSet, Kv, MAX_DEPTH, Mapper, Obj, Rc, Value, View, guid, json}; /// An override row names a layer of the main by its current GUID or by the `overrideKey` the /// layer had when the row was written: the key becomes the current GUID, unless the layer is diff --git a/crates/format/src/fig/map/connector.rs b/crates/format/src/fig/map/connector.rs index 172616dc..cd17680f 100644 --- a/crates/format/src/fig/map/connector.rs +++ b/crates/format/src/fig/map/connector.rs @@ -1,5 +1,5 @@ use super::layer::{cap_name, own_text, svg_path, valid_size}; -use super::*; +use super::{Affine, Kv, Mapper, NO_STYLE, Obj, Point, Value, View, guid, json, matrix, network, num, rows}; impl<'a> Mapper<'a> { /// A connector's end caps, and when it has no saved outline or network a straight line diff --git a/crates/format/src/fig/map/document.rs b/crates/format/src/fig/map/document.rs index d31ef5c6..69f221c1 100644 --- a/crates/format/src/fig/map/document.rs +++ b/crates/format/src/fig/map/document.rs @@ -1,7 +1,7 @@ use super::component::{assigned, prop_guid}; use super::paint::color; use super::variables::variable_value; -use super::*; +use super::{Affine, BTreeMap, BTreeSet, Kv, MAX_DEPTH, Mapper, Obj, Value, View, copy_str, guid, json, rows}; impl<'a> Mapper<'a> { /// The DOCUMENT with its pages. diff --git a/crates/format/src/fig/map/layout.rs b/crates/format/src/fig/map/layout.rs index f4d50891..7900c453 100644 --- a/crates/format/src/fig/map/layout.rs +++ b/crates/format/src/fig/map/layout.rs @@ -1,5 +1,5 @@ use super::paint::{bound, color}; -use super::*; +use super::{BTreeMap, BTreeSet, Kv, MAX_GRID_TRACK_VALUE, MAX_GRID_TRACKS, Mapper, Obj, Value, View, copy_num, guid, json, num}; impl<'a> Mapper<'a> { pub(super) fn auto_layout(&mut self, o: &mut Obj, v: &View<'a>) { diff --git a/crates/format/src/fig/map/paint.rs b/crates/format/src/fig/map/paint.rs index fe8cfa7b..808e6fc8 100644 --- a/crates/format/src/fig/map/paint.rs +++ b/crates/format/src/fig/map/paint.rs @@ -1,6 +1,6 @@ use super::layer::cap_name; use super::variables::alias; -use super::*; +use super::{Affine, Kv, Mapper, NO_STYLE, Obj, Point, Value, View, copy_num, copy_str, guid, json, matrix, num, rows, vec2}; fn filter_number(value: &Kv) -> Option { let number = match value { diff --git a/crates/format/src/fig/map/proto.rs b/crates/format/src/fig/map/proto.rs index d3f5c022..9238cafb 100644 --- a/crates/format/src/fig/map/proto.rs +++ b/crates/format/src/fig/map/proto.rs @@ -1,6 +1,6 @@ use super::paint::color; use super::variables::variable_data; -use super::*; +use super::{Kv, MAX_ACTION_DEPTH, Mapper, Obj, Value, View, copy_str, guid, json, num, ref_guid}; impl<'a> Mapper<'a> { pub(super) fn prototype(&mut self, o: &mut Obj, v: &View<'a>) { diff --git a/crates/format/src/fig/map/text.rs b/crates/format/src/fig/map/text.rs index 7431fbb5..6227c4d0 100644 --- a/crates/format/src/fig/map/text.rs +++ b/crates/format/src/fig/map/text.rs @@ -1,5 +1,5 @@ use super::paint::{paint, style_link}; -use super::*; +use super::{Kv, Mapper, Obj, Value, View, copy_num, copy_str, json, network, num}; /// The value from the last override layer holding a valid one for an optional text setting; invalid instance rows fall through. fn text_num(v: &View, key: &str) -> Option { diff --git a/crates/format/src/fig/map/variables.rs b/crates/format/src/fig/map/variables.rs index d27c834b..8d891ded 100644 --- a/crates/format/src/fig/map/variables.rs +++ b/crates/format/src/fig/map/variables.rs @@ -1,5 +1,5 @@ use super::paint::color; -use super::*; +use super::{Kv, MAX_EXPR_DEPTH, Mapper, Obj, Value, View, guid, json, num, ref_guid}; impl<'a> Mapper<'a> { pub(super) fn variable_bindings(&mut self, o: &mut Obj, v: &View<'a>) {