Simplify constructor function

I agree. The one case I think might be both worthwhile and easily understood would be if we:

  1. Allow = functions, and
  2. Allow omitting the return type on an = function, if and only if the right-hand side immediately starts with a type name and has that type. This is not type inference; this would only work if the (possibly qualified) type name appears immediately after the =.

That would allow, for instance, fn new(...) = Self { ... }, which seems pretty clear. It would also allow fn new(...) = Self::default();.

2 Likes