A colleague of mine just generalized my program using traits. (You can tell I'm not a RealProgrammer™ because I like what he did to my code.) These traits have really long, meaningful names, which I think is a good thing, and there are lots of them. I'd like to find a way to make the code more readable.
Say I have
struct Foo<T: Trait1<Trait2>, U: 'static + Clone + Trait3, V: Trait4<Trait5>, W: 'static + Clone + Trait6{ ... }
and
impl<T: Trait1<Trait2>, U: `static + Clone + Trait3, V: Trait4<Trait5>, W: 'static + Clone + Trait6 { ... }
except each of the trait names, including T, U, V, and W, is 10 characters or more long. For example, the impl
statement is 330 characters long.
I could give each of the long names a short alias, but that defeats their purpose. Is there a way to use a newtype or type alias to improve readabiity?