Skip to content

Docs reference removed Try_ConvertResult instead of new FromResidual approach #175

Description

@sourcery-ai

The current API documentation still references and demonstrates usage of Try_ConvertResult, which appears to have been removed or deprecated from the codebase.

In particular, there is an example that:

  • Imports Try_ConvertResult
  • Derives Try_ConvertResult

This has two negative effects:

  1. Compilation failure for users: Copy‑pasting the example into a project will fail to compile because Try_ConvertResult no longer exists.
  2. Conceptual confusion: The example demonstrates an outdated pattern instead of the current recommended approach using #[FromResidual(Result<_, Self::Residual>)].

Requested changes

  • Update the affected API docs example(s) to use the new #[FromResidual(Result<_, Self::Residual>)] pattern.
  • Remove Try_ConvertResult from:
    • The import list in the example
    • The derive list in the example
  • Verify that all API docs and examples referencing Try_ConvertResult are updated or removed, ensuring there are no remaining references to the old construct.
  • Confirm that the revised example compiles and correctly demonstrates the intended usage.

Action items

  1. Identify all documentation pages and code examples that mention Try_ConvertResult.
  2. Replace these references with the current recommended approach using #[FromResidual(Result<_, Self::Residual>)].
  3. Run cargo doc (or the appropriate documentation build command) and ensure all examples compile and tests pass.
  4. Add a brief note or migration hint (if appropriate) explaining the change from Try_ConvertResult to FromResidual for users familiar with the old API.

This will keep the documentation aligned with the current API and prevent users from encountering compilation errors when following the examples.


I created this issue for @MusicalNinjaDad from #174 (comment).

Tips and commands

Getting Help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions