Skip to content

Support trait methods that return Result<Self, ...> and Option

Detects when trait methods return Result<Self, ...> or Option<Self> and expands the variant access with #call.map(Into::into). This takes advantage of the existing From/Into definitions for the Enum and its Variants.

The detection is robust to several variations for referring to these types:

  • Result
  • std::result::Result
  • core::result::Result
  • Option
  • std::option::Option
  • core::option::Option

Fixes #82

Merge request reports

Loading