use syn::Ident; use core_extensions::prelude::*; use shared::either::Either; pub trait Trivial{ type Trivial:?Sized; } impl Trivial for X{ type Trivial=X; } pub trait OptIdent:TypeIdentity>{ fn or_index(&self,index:usize)->Either<&Ident,usize>{ self.into_type_ref().as_ref().map_or(Either::Right(index),Either::Left) } } impl OptIdent for Option{}