Skip to content

mdl: write_view_segment takes ten arguments #406

Open

Description

@bpowers

write_view_segment in src/simlin-engine/src/mdl/writer.rs takes ten arguments behind #[allow(clippy::too_many_arguments)].
Most of them are the same for every segment of a view: view_elements, use_lettered_polarity, elem_positions, name_map, stock_uids, link_compat_by_uid.
write_sketch_section builds them once per view and passes them to each segment.

Fix

Bundle the per-view values into one struct built in write_sketch_section and pass it by reference; write_view_segment then takes that struct plus the per-segment name, elements, font and offset, and the allow goes away.
FlowConnectorContext in the same file already does this for the flow-pipe helper and can probably be built from the new struct.

Activity

  1. added
    engine
    hygiene
    on Jun 8, 2026
  2. changed the title [-]Refactor write_view_segment in MDL writer to reduce parameter count[/-] [+]mdl: write_view_segment takes ten arguments[/+] on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enginehygiene

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions