Skip to content

Duplicated capture_screenshot_internal functions #12

@codehakase

Description

@codehakase

Description

capture_screenshot_internal and capture_screenshot_internal_with_auto_copy in src-tauri/src/lib.rs share ~90% identical code (lines 58-201). The only difference is how the auto_copy flag is obtained: one reads it from ConfigState, the other takes it as a parameter.

This duplication is a maintenance hazard - any bug fix or behavior change needs to be applied in both places.

Suggested fix

Collapse into a single function that takes auto_copy: bool as a parameter. The Tauri command wrapper can read the config and pass the value in.

Relevant code

  • capture_screenshot_internal: src-tauri/src/lib.rs:58-131
  • capture_screenshot_internal_with_auto_copy: src-tauri/src/lib.rs:133-201

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions