derive_more icon indicating copy to clipboard operation
derive_more copied to clipboard

Generalised deriving for enums

Open JelteF opened this issue 6 years ago • 0 comments
trafficstars

As was initially proposed in #87, it would be very useful to have a general way of deriving for enums. The basic idea is that when there's an enum we all variants forward to their fields. So in case of Index something like the following would work:

#[derive(Index)]
enum VecOrSlice<'slice> {
    Vec(Vec<123>)
    Slice(&'slice [123])
}

JelteF avatar Nov 02 '19 19:11 JelteF