I guess? It's certainly less nice than #[derive(Deref, DerefMut)] on the
type, but maybe there are some downsides of derives that I'm not aware of.

On Sat, Jul 15, 2017 at 10:27 AM, Jim Blandy <jbla...@mozilla.com> wrote:

> A macro_rules macro wouldn't serve here?
>
> On Fri, Jul 14, 2017 at 5:26 PM, Bobby Holley <bobbyhol...@gmail.com>
> wrote:
>
> > On Fri, Jul 14, 2017 at 2:24 AM, Anthony Ramine <n.ox...@gmail.com>
> wrote:
> >
> > >
> > > > Le 14 juil. 2017 à 02:13, Bobby Holley <bobbyhol...@gmail.com> a
> > écrit :
> > > >
> > > > There's a lot of boilerplate involved just to make a newtype [1]. Is
> > this
> > > > something we could add a custom derive for?
> > >
> > > We don't use that many newtypes to justify writing a custom derive for
> > > that IMO. Often we don't even bother and just do wrapper.0.
> > >
> >
> > Well, we all do that because writing 10 lines of boilerplate is usually
> > worse than scattering some .0s around. If there were a 1-line derive we
> > might use it more.
> >
> >
> > > Remove all the unneeded where clauses for E on the type definition, and
> > on
> > > the Deref* impls and you have only ~10 lines of boilerplate.
> > >
> > > _______________________________________________
> > > dev-servo mailing list
> > > dev-servo@lists.mozilla.org
> > > https://lists.mozilla.org/listinfo/dev-servo
> > >
> > _______________________________________________
> > dev-servo mailing list
> > dev-servo@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-servo
> >
> _______________________________________________
> dev-servo mailing list
> dev-servo@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo
>
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to