Skip to content

Apply #[must_use] across pure fns, builders, and Result-returning fns #338

@joaquinbejar

Description

@joaquinbejar

Overview

Apply #[must_use] across the public surface per the rules: every pure
function (pricing, greeks, validation, parsing, conversions), every builder
method, and every Result-returning function whose outcome the caller MUST
handle (PricingResult, StrategyResult, PositionResult).

Context

  • rules/global_rules.md §Compiler Attributes — §#[must_use].
  • Builder methods should use
    #[must_use = "builders do nothing unless .build() is called"].

Tasks

  • Audit every public fn; add #[must_use] to pure accessors, pricing /
    greek computations, new / try_new / build methods, and
    Result-returning functions on critical paths
  • Builder method messages per rules

Acceptance criteria

  • cargo clippy -- -W must_use_candidate -W must_use_unit reports no
    high-signal omissions (project-specific allow-list documented)
  • cargo clippy --all-targets --all-features --workspace -- -D warnings clean
  • cargo test --all-features --workspace clean

References

  • rules/global_rules.md — §Compiler Attributes

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationrefactorCode refactoring without changing behavior

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions