derive_more icon indicating copy to clipboard operation
derive_more copied to clipboard

Add new derive: AsVariant

Open crazymerlyn opened this issue 1 year ago • 10 comments
trafficstars

Resolves #358

Synopsis

A new derive for generating as_foo, as_bar methods for an enum with fields foo and bar.

Solution

Similar to TryUnwrap but generates functions returning an Option instead of a Result.

Checklist

  • [x] Documentation is updated (if required)
  • [x] Tests are added/updated (if required)
  • [x] CHANGELOG entry is added (if required)

crazymerlyn avatar Sep 27 '24 23:09 crazymerlyn