Skip to content

[PR #27] Field-level rustdoc missing on core types; no #[must_use] policy #69

@obchain

Description

@obchain

PR: #27 (commit 4a9a6d3)
File: crates/charon-core/src/types.rs, lines 24-36 (Position), 62-76 (LiquidationOpportunity)

Fields collateral_amount, debt_amount, chain_id, collateral_token, debt_token, debt_to_repay, expected_collateral_out have no /// doc comments. Project policy (CLAUDE.md) requires docs to ship in rustdoc, not .md files. Missing field docs leave callers to infer whether amounts are in token base units or scaled, and what debt_to_repay ceiling is (50% for Aave-style, 100% for Compound-style).

Per criterion 12, constructors returning LiquidationOpportunity must be annotated #[must_use]. No constructor exists yet, but adding #![warn(clippy::must_use_candidate)] at crate root now enforces this automatically when one is added.

Fix:

  1. Add /// field doc comments stating units and valid ranges.
  2. Add #![warn(clippy::must_use_candidate)] to crates/charon-core/src/lib.rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p2-polishNice-to-have / polishtype:docsDocumentation change

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions