Skip to content

Add # Examples doc test to InvoiceStatus::to_u8 and from_u8 #636

Description

@Kingsman-99

Description

to_u8() and from_u8() in contracts/split/src/types.rs are utility methods used in compact storage encoding. Adding /// # Examples doc tests with a round-trip example makes the API self-documenting and allows cargo test --doc to verify the examples remain correct.

Acceptance Criteria

  • Add a /// # Examples doc block to to_u8() showing InvoiceStatus::Released.to_u8() == 1
  • Add a /// # Examples doc block to from_u8() showing InvoiceStatus::from_u8(1) == InvoiceStatus::Released
  • cargo test --doc passes

Context

  • Target file: contracts/split/src/types.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: highComplex feature requiring deep knowledge - 200 ptsdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions