Skip to content

Add doctest coverage for FragmentId Display and AsRef<str> trait implementations #226

@coderabbitai

Description

@coderabbitai

Summary

Two public trait implementations in crates/whitaker_clones_core/src/index/fragment_id.rs introduced in PR #218 have no test coverage of any kind:

Item Status
impl fmt::Display for FragmentId No unit test, no doctest
impl AsRef<str> for FragmentId No unit test, no doctest

Both are single-line delegations to as_str, so the risk is low, but coverage should be present to meet the project standard of not treating warnings as optional.

Proposed resolution

Add one inline /// # Examples doctest block to each implementation's declaration site in crates/whitaker_clones_core/src/index/fragment_id.rs:

  1. Display doctest — assert that format!("{id}") produces the same string as the underlying value.
  2. AsRef<str> doctest — assert that .as_ref() returns the same slice as .as_str().

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions