WithValueless

0.3.0

A Swift macro to generate a copy of the enum with no associated values.
laosb/WithValueless

What's New

2023-09-17T17:26:47Z

WithValueless

A Swift macro to generate a copy of the enum with no associated values.

import WithValueless

@WithValueless
indirect enum Unit {
  case ton, kilogram, gram
  case kilometer, meter, decimeter, centimeter
  case currency(code: String)
  case derived(Unit, power: Int)
  case derived(Unit, by: Unit)
  case custom(String)
}

// Expands:

enum ValuelessUnit {
  case ton, kilogram, gram
  case kilometer, meter, decimeter, centimeter
  case currencyCodeString
  case derivedUnitPowerInt
  case derivedUnitByUnit
  case customString
}

License

MIT.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Fri Oct 18 2024 08:32:09 GMT-0900 (Hawaii-Aleutian Daylight Time)