Replace many manual trait impls with use of educe
Addresses #366 (closed).
- Replace many open-coded
Debugimpls with use ofeduce. Fields that ought not to be (or cannot be) dumped are skipped with a newskip_fmthelper function. I did this because (i) it arranges that the field name gets printed; (ii) educe does not have a way to arrange for the finish call to befinish_non_exhaustive. - Replace two open-coded
Cloneimpls. These existed simply because stock#[derive(Clone)]infers overly-restrictiveClonebounds on generic parameters. - Replace a number of open-coded
Defaultimpls for enums, marking the default variant#[educe(Default)]. I prefer this because it is more declarative, and puts the default information closer to the type. And it is shorter :-).
In general the added code is use and #[educe(Debug)] and so on; the removed lines are open-coded impls. See also !374 (merged) which is the part that didn't need educe.