Skip to content

[audit] dead-code: unused Rust crates dispatch2 and block2 in Cargo.toml #513

@claude

Description

@claude

Problem

Two macOS-only Rust crate dependencies in src-tauri/Cargo.toml are never used in source code:

1. dispatch2 (line 54)

dispatch2 = "0.2" — zero imports. The only mention is a comment in src-tauri/src/pdf_export/renderer.rs:11 explaining why it was intentionally not used:

Uses app.run_on_main_thread() (tao event loop) instead of dispatch2::Queue::main().exec_async() (GCD).

2. block2 (line 58)

block2 = "0.6" — zero imports (block2:: never appears in source). Note that block2 is also listed as a feature of objc2-web-kit (line 55), which pulls it in transitively. The standalone dependency is unnecessary.

Impact

Dead dependencies increase compile time and binary size. dispatch2 pulls in additional GCD bindings that are never linked.

Suggested Fix

Remove both from [target.'cfg(target_os = "macos")'.dependencies]:

-dispatch2 = "0.2"
-block2 = "0.6"

Verify with cargo check --target aarch64-apple-darwin after removal.

Files

  • src-tauri/Cargo.toml:54 (dispatch2)
  • src-tauri/Cargo.toml:58 (block2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditCodebase audit findingdead-codeDead or unreachable code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions