Skip to content

fix(contracts): remove crate-level lint suppressions and leftover scaffolding - #479

Merged
Penielka merged 1 commit into
AetherEdu:mainfrom
peaceshallom37-rgb:fix/issue-474-crate-lint-suppressions
Aug 25, 2026
Merged

fix(contracts): remove crate-level lint suppressions and leftover scaffolding#479
Penielka merged 1 commit into
AetherEdu:mainfrom
peaceshallom37-rgb:fix/issue-474-crate-lint-suppressions

Conversation

@peaceshallom37-rgb

Copy link
Copy Markdown
Contributor

Closes #474

Summary

Removes the crate-wide lint suppressions from contracts/src/lib.rs so real findings are no longer hidden for the whole codebase, and deletes the leftover lib_minimal.rs build-verification stub.

Changes

  • lib.rs — removed #![allow(deprecated)], #![allow(clippy::too_many_arguments)], #![allow(clippy::manual_checked_ops)], #![allow(clippy::needless_range_loop)] from the crate root.
  • credentials.rs — added the missing Symbol import (a genuine compile error that was previously the only thing failing cargo clippy -- -D warnings on main).
  • dynamic_fees.rs — replaced manual zero-guard + division patterns with checked_mul/checked_div (clippy manual_checked_ops).
  • credentials.rs / user_profile.rs — rewrote index-only loops with iterator form (clippy needless_range_loop).
  • Scoped allows — the remaining allowances are now attached to the individual items that need them:
    • #[allow(deprecated)] on the 16 modules that still emit events via the legacy env.events().publish API, with a comment noting the pending #[contractevent] migration.
    • #[allow(clippy::too_many_arguments)] on contract-ABI functions whose signatures must stay fixed (and on the #[contractimpl] block for macro-generated client wrappers).
  • lib_minimal.rs — deleted; it was unreferenced scaffolding, not a test.

Verification

  • cargo clippy -- -D warnings (the CI command in build-contracts) passes cleanly.
  • cargo build --release succeeds.
  • cargo fmt --all -- --check shows only pre-existing diffs in files untouched by this PR.

Note: cargo test targets currently fail to compile on main due to pre-existing type errors in test files (e.g. dna_storage_test.rs); that is tracked separately and is not addressed here.

…ffolding

Drops the crate-wide `#![allow(...)]` attributes from lib.rs so real lint
findings are no longer hidden for the whole codebase. The underlying issues
are fixed (missing `Symbol` import in credentials.rs, manual checked
divisions, range loops) and the remaining allowances are scoped to the
individual modules/functions that legitimately need them (legacy
`env.events().publish` event API pending `#[contractevent]` migration, and
fixed contract-ABI argument counts).

Also deletes src/lib_minimal.rs, a leftover build-verification stub that is
not a test and is unreferenced by the crate.

`cargo clippy -- -D warnings`, already part of CI for the contracts crate,
now passes cleanly.

Closes AetherEdu#474
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.

[Contracts][Tech-debt] Crate-level lint suppression and leftover scaffolding (lib_minimal.rs, blanket clippy allows)

2 participants