Skip to content

fix(rust): gate Windows-only font alias helpers behind cfg(windows) - #195

Merged
shps951023 merged 1 commit into
mainfrom
fix/rust-clippy-font-dead-code
Sep 20, 2026
Merged

shps951023 merged 1 commit into
mainfrom
fix/rust-clippy-font-dead-code

Conversation

@shps951023

@shps951023 shps951023 commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Summary

The Crates.io Publish workflow failed at its Lint step (cargo clippy -D warnings) because three font-alias helpers in crates/minipdf/src/fonts.rs are only used from the Windows-only cloud-font registration path. On the Ubuntu runner they are dead code.

Changes

  • Gate font_alias_from_data, build_font_alias, and normalize_font_alias behind #[cfg(target_os = "windows")].
  • Gate the corresponding builds_stable_cloud_font_aliases test and its import the same way.

Validation

  • cargo clippy --workspace --all-targets --locked -- -D warnings passes.
  • cargo test --workspace --locked passes (112 lib tests + CLI tests).

Summary by CodeRabbit

  • Refactor
    • Limited Windows-specific font processing to Windows builds.
    • Kept related font tests aligned with platform-specific behavior.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 6aa4fca2-8f9d-4bf8-8151-b613a16559c1

📥 Commits

Reviewing files that changed from the base of the PR and between c81407c and bbc7589.

📒 Files selected for processing (1)
  • minipdf-rs/crates/minipdf/src/fonts.rs

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The font alias helpers and their test import now compile only on Windows.

Changes

Font alias platform gating

Layer / File(s) Summary
Gate Windows font alias helpers
minipdf-rs/crates/minipdf/src/fonts.rs
font_alias_from_data, build_font_alias, and normalize_font_alias now use Windows-only compilation gates. The test import for build_font_alias uses the same gate.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: gating Windows-only font alias helpers with cfg(windows).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@shps951023
shps951023 merged commit 9975712 into main Sep 20, 2026
7 checks passed
@shps951023
shps951023 deleted the fix/rust-clippy-font-dead-code branch September 20, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant