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
Context
- Target file:
contracts/split/src/types.rs
Description
to_u8()andfrom_u8()incontracts/split/src/types.rsare utility methods used in compact storage encoding. Adding/// # Examplesdoc tests with a round-trip example makes the API self-documenting and allowscargo test --docto verify the examples remain correct.Acceptance Criteria
/// # Examplesdoc block toto_u8()showingInvoiceStatus::Released.to_u8() == 1/// # Examplesdoc block tofrom_u8()showingInvoiceStatus::from_u8(1) == InvoiceStatus::Releasedcargo test --docpassesContext
contracts/split/src/types.rs