Skip to content

chore: silence unused-import warning in test_ibe macro#34

Merged
rubenhensen merged 1 commit into
mainfrom
chore/silence-test-ibe-glob-warning
May 17, 2026
Merged

chore: silence unused-import warning in test_ibe macro#34
rubenhensen merged 1 commit into
mainfrom
chore/silence-test-ibe-glob-warning

Conversation

@dobby-coder
Copy link
Copy Markdown
Contributor

@dobby-coder dobby-coder Bot commented May 16, 2026

Closes #33.

Summary

The test_ibe! macro in src/test_macros.rs emits one clippy warning:

warning: unused import: `super::*`

The issue suggested simply removing the use super::*; line. That doesn't work: the macro body references PublicKey, SecretKey, UserSecretKey, CipherText, Msg, the IBE trait, and each scheme type (Waters, WatersNaccache, BoyenWaters) — all brought in via the glob. Removing the line produces 42 compile errors.

The warning is a clippy false positive: across the three invocation sites, the import is needed but clippy's per-expansion usage tracking can't see that. The minimal fix is to annotate the import with #[allow(unused_imports)].

Verification

  • cargo clippy --all-features --all-targets — warning-free
  • cargo test --all-features — 21 passed, 0 failed
  • cargo fmt --check — clean

Reviewer quickstart

git fetch origin && git checkout chore/silence-test-ibe-glob-warning && cargo clippy --all-features --all-targets && cargo test --all-features

The `use super::*;` glob in test_ibe! is required (the macro body
references PublicKey, SecretKey, UserSecretKey, CipherText, Msg, IBE,
and the scheme type from the parent module), but clippy reports it as
unused because not every call site exercises every re-export the same
way. Annotate with #[allow(unused_imports)] to suppress the false
positive without dropping the import.

Closes #33

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dobby-coder dobby-coder Bot marked this pull request as ready for review May 16, 2026 23:40
@dobby-coder dobby-coder Bot requested a review from rubenhensen May 16, 2026 23:42
@dobby-coder
Copy link
Copy Markdown
Contributor Author

dobby-coder Bot commented May 16, 2026

Rule compliance check: assigned @rubenhensen as reviewer (per the pr-review-assignments rule).

Copy link
Copy Markdown
Contributor Author

@dobby-coder dobby-coder Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally:

  • cargo clippy --all-features --all-targets — clean, no warnings
  • cargo test --all-features — 21 passed
  • Confirmed removing use super::*; is not viable: the macro body references PublicKey/SecretKey/UserSecretKey/CipherText/Msg/IBE/Waters/WatersNaccache/BoyenWaters via the glob.

The #[allow(unused_imports)] annotation is a precise, minimal fix — clippy's per-expansion usage tracking can't see the import is actually used across the three call sites, so suppressing at the import line (rather than at every call site) is the correct scope. Looks good to me; cannot self-approve.

@rubenhensen rubenhensen merged commit cc53f5c into main May 17, 2026
7 checks passed
@rubenhensen rubenhensen deleted the chore/silence-test-ibe-glob-warning branch May 17, 2026 16:07
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.

chore: remove unused use super::*; in test_ibe macro

1 participant