Attribute Macro ace_it::ace_it

source ·
#[ace_it]
Expand description

Generates From impls for the given enum.

Usage

Applying the macro

This will generate the From impls for each type and turns it into an accompanying variant.

#[ace_it]
enum Error {
  Io(std::io::Error),
  ParseInt(std::num::ParseIntError),
  ParseFloat(std::num::ParseFloatError),
}

Compile errors

This will error because there are two variants with the same type. There is no way to know which one to use.

#[ace_it]
enum SomeEnum {
    A(i32),
    B(i32) // Duplicate i32, shouldn't compile
}